x86/intel/cacheinfo: Shut up last long-standing warning
authorBorislav Petkov <bp@suse.de>
Sat, 8 Jun 2013 16:48:15 +0000 (18:48 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 20 Jun 2013 10:27:41 +0000 (12:27 +0200)
commit719038de98bc8479b771c582a1e4a1e86079da22
tree92eac51c7a8d0e89cf683fc195f88278ef5155cf
parent4d067d8e056d76a3327f0517c7722db55e7888fc
x86/intel/cacheinfo: Shut up last long-standing warning

arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘init_intel_cacheinfo’:
arch/x86/kernel/cpu/intel_cacheinfo.c:642:28: warning: ‘this_leaf.size’ may be used uninitialized in this function [-Wmaybe-uninitialized] arch/x86/kernel/cpu/intel_cacheinfo.c:643:29: warning: ‘this_leaf.eax.split.num_threads_sharing’ may be used uninitialized in this function [-Wmaybe-uninitialized]

This keeps on happening during randbuilds and the compiler is
wrong here:

In the case where cpuid4_cache_lookup_regs() returns 0, both
this_leaf.size and this_leaf.eax get initialized. In the case
where the CPUID leaf doesn't contain valid cache info, we error
out which init_intel_cacheinfo() handles correctly without
touching the abovementioned fields.

So shut up the warning by clearing out the struct which we hand
down.

While at it, reverse error handling and gain one indentation
level.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1370710095-20547-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/intel_cacheinfo.c