From: Aristeu Rozanski Date: Thu, 21 Nov 2013 14:08:03 +0000 (-0500) Subject: sb_edac: Shut up compiler warning when EDAC_DEBUG is enabled X-Git-Tag: firefly_0821_release~176^2~4776^2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bd4b9683623d0d91e87cf22f09008c05f56d7483;p=firefly-linux-kernel-4.4.55.git sb_edac: Shut up compiler warning when EDAC_DEBUG is enabled Fix this: In file included from drivers/edac/sb_edac.c:27:0: drivers/edac/sb_edac.c: In function ‘sbridge_mce_output_error’: drivers/edac/edac_core.h:50:8: warning: ‘limit’ may be used uninitialized in this function [-Wmaybe-uninitialized] printk(level "EDAC " prefix ": " fmt, ##arg) ^ drivers/edac/sb_edac.c:948:25: note: ‘limit’ was declared here u64 ch_addr, offset, limit, prv = 0; Limit can be initialized to 0. The only way limit wouldn't be initialized is if there are no DIMMs present (which would be a bug of course) and it'd fail on the next test. Signed-off-by: Aristeu Rozanski Cc: Mauro Carvalho Chehab Link: http://lkml.kernel.org/r/20131121122021.GD26009@pd.tnic Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 8472405c5586..d7f1b57bd3be 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -945,7 +945,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, u32 tad_offset; u32 rir_way; u32 mb, kb; - u64 ch_addr, offset, limit, prv = 0; + u64 ch_addr, offset, limit = 0, prv = 0; /*