diff options
author | H. Peter Anvin <hpa@zytor.com> | 2019-02-20 19:49:12 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2019-02-20 19:49:12 -0800 |
commit | 05ac953c23f90b2328d393f7eecde96e41aed067 (patch) | |
tree | 759fe3d75276aac5c7f9dd7dcbfb56323a85fff1 /core | |
parent | 090ba3a2aa9bc3f6b5491b09f51b76836c014fee (diff) | |
download | syslinux-master.tar.gz syslinux-master.tar.xz syslinux-master.zip |
There is no reason to do the fairly complex flag-test sequence twice,
when we might as well check for both flags at the same time.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/dmi.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -317,6 +317,7 @@ struct cpuflag { static void sysappend_set_cpu(void) { + unsigned long have_eflags; static char cpu_str[6+6] = "CPU="; char *p = cpu_str + 4; static const struct cpuflag cpuflags[] = { @@ -331,10 +332,11 @@ static void sysappend_set_cpu(void) const struct cpuflag *cf; /* Not technically from DMI, but it fit here... */ + have_eflags = cpu_has_eflags(EFLAGS_ID|EFLAGS_AC); - if (!cpu_has_eflag(EFLAGS_ID)) { + if (!(have_eflags & EFLAGS_ID)) { /* No CPUID */ - *p++ = cpu_has_eflag(EFLAGS_AC) ? '4' : '3'; + *p++ = (have_eflags & EFLAGS_AC) ? '4' : '3'; } else { uint32_t flags[4], eax, ebx, family; uint32_t ext_level; |