]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/cpu/intel_cacheinfo.c
x86: fix sparse warnings in intel_cacheinfo.c
[karo-tx-linux.git] / arch / x86 / kernel / cpu / intel_cacheinfo.c
index 8b4507b8469b18ed09f906e35b94ba6649e75b8a..1b889860eb730fc3081b31d02fd304c923667711 100644 (file)
@@ -352,8 +352,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
         */
        if ((num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1) {
                /* supports eax=2  call */
-               int i, j, n;
-               int regs[4];
+               int j, n;
+               unsigned int regs[4];
                unsigned char *dp = (unsigned char *)regs;
                int only_trace = 0;
 
@@ -368,7 +368,7 @@ unsigned int __cpuinit 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] & (1 << 31)) regs[j] = 0;
                        }
 
                        /* Byte 0 is level count, not a descriptor */