]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/cpu/intel_cacheinfo.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / arch / x86 / kernel / cpu / intel_cacheinfo.c
index 7c6f7d548c0f94d76c094a950f7ef29fc1356b32..8dc72dda66fe0a301a8eb87ab3fd9ac078bd5200 100644 (file)
@@ -618,36 +618,34 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
                 * parameters cpuid leaf to find the cache details
                 */
                for (i = 0; i < num_cache_leaves; i++) {
-                       struct _cpuid4_info_regs this_leaf;
+                       struct _cpuid4_info_regs this_leaf = {};
                        int retval;
 
                        retval = cpuid4_cache_lookup_regs(i, &this_leaf);
-                       if (retval >= 0) {
-                               switch (this_leaf.eax.split.level) {
-                               case 1:
-                                       if (this_leaf.eax.split.type ==
-                                                       CACHE_TYPE_DATA)
-                                               new_l1d = this_leaf.size/1024;
-                                       else if (this_leaf.eax.split.type ==
-                                                       CACHE_TYPE_INST)
-                                               new_l1i = this_leaf.size/1024;
-                                       break;
-                               case 2:
-                                       new_l2 = this_leaf.size/1024;
-                                       num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-                                       index_msb = get_count_order(num_threads_sharing);
-                                       l2_id = c->apicid & ~((1 << index_msb) - 1);
-                                       break;
-                               case 3:
-                                       new_l3 = this_leaf.size/1024;
-                                       num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-                                       index_msb = get_count_order(
-                                                       num_threads_sharing);
-                                       l3_id = c->apicid & ~((1 << index_msb) - 1);
-                                       break;
-                               default:
-                                       break;
-                               }
+                       if (retval < 0)
+                               continue;
+
+                       switch (this_leaf.eax.split.level) {
+                       case 1:
+                               if (this_leaf.eax.split.type == CACHE_TYPE_DATA)
+                                       new_l1d = this_leaf.size/1024;
+                               else if (this_leaf.eax.split.type == CACHE_TYPE_INST)
+                                       new_l1i = this_leaf.size/1024;
+                               break;
+                       case 2:
+                               new_l2 = this_leaf.size/1024;
+                               num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
+                               index_msb = get_count_order(num_threads_sharing);
+                               l2_id = c->apicid & ~((1 << index_msb) - 1);
+                               break;
+                       case 3:
+                               new_l3 = this_leaf.size/1024;
+                               num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
+                               index_msb = get_count_order(num_threads_sharing);
+                               l3_id = c->apicid & ~((1 << index_msb) - 1);
+                               break;
+                       default:
+                               break;
                        }
                }
        }