]> xenbits.xensource.com Git - xen.git/commitdiff
x86: adjust comparison for earlier signedness change
authorJan Beulich <jbeulich@suse.com>
Fri, 11 Aug 2023 07:59:49 +0000 (09:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Aug 2023 07:59:49 +0000 (09:59 +0200)
Interestingly only Clang warns about the now bogus less-than-zero
comparison. Convert it to something that's more explicitly doing what
the comment says.

Fixes: 4086857cc159 ("x86: implement cpuid() in terms of cpuid_count()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/cpu/intel_cacheinfo.c

index 1b5c4c553d4eb4e427738e24262b2c2446cd9998..9cfb759be03036b51c04e39755e00399bcc91ad4 100644 (file)
@@ -187,7 +187,8 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c)
 
                        /* If bit 31 is set, this is an unknown format */
                        for ( j = 0 ; j < 3 ; j++ ) {
-                               if ( regs[j] < 0 ) regs[j] = 0;
+                               if ( regs[j] >> 31 )
+                                       regs[j] = 0;
                        }
 
                        /* Byte 0 is level count, not a descriptor */