• B
    x86/intel/cacheinfo: Shut up last long-standing warning · 719038de
    Borislav Petkov 提交于
    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: NBorislav Petkov <bp@suse.de>
    Link: http://lkml.kernel.org/r/1370710095-20547-1-git-send-email-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
    719038de
intel_cacheinfo.c 32.8 KB