From 4fad0af2782115ba9c0527b297837193af3a9402 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 6 Nov 2017 01:09:48 +0000 Subject: [PATCH] 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 --- drivers/edac/i7300_edac.c | 1 + 1 file changed, 1 insertion(+) 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++) { -- 2.39.2