[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86: adjust comparison for earlier signedness change



commit a9a3b432a87b27e4debd6f80f14e2cfc9f52218c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Aug 11 09:59:49 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Aug 11 09:59:49 2023 +0200

    x86: adjust comparison for earlier signedness change
    
    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@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c 
b/xen/arch/x86/cpu/intel_cacheinfo.c
index 1b5c4c553d..9cfb759be0 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -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 */
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.