summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2017-11-06 01:09:48 +0000
committerBen Hutchings <ben@decadent.org.uk>2017-11-11 13:34:43 +0000
commit4fad0af2782115ba9c0527b297837193af3a9402 (patch)
treea8e21caa694ad86aa54dca74ad20d26e39a4bedb
parent8ca8e09f7896f9effc62e48119a606243765cd73 (diff)
downloadlinux-4fad0af2782115ba9c0527b297837193af3a9402.tar.gz
linux-4fad0af2782115ba9c0527b297837193af3a9402.tar.bz2
linux-4fad0af2782115ba9c0527b297837193af3a9402.zip
edac: i7300_edac: Fix 'may be used uninitialized' warning
gcc 4.7 warns that nr_pages may be used uninitialized in i7300_init_csrows(). In fact, the case where it's not initialised is an error that will result in returning early without using it. Silence the warning by initialising to 0. This was done upstream as part of commit 084a4fccef39 "edac: move dimm properties to struct dimm_info". Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/edac/i7300_edac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index 1e084260c9c0..9afb59890c65 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -803,6 +803,7 @@ static int i7300_init_csrows(struct mem_ctl_info *mci)
}
/* Get the set of MTR[0-7] regs by each branch */
+ nr_pages = 0;
for (slot = 0; slot < MAX_SLOTS; slot++) {
int where = mtr_regs[slot];
for (branch = 0; branch < MAX_BRANCHES; branch++) {