diff options
author | James Hogan <jhogan@kernel.org> | 2017-11-13 11:12:06 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2017-11-27 05:57:26 -0500 |
commit | 544e92581a2ac44607d7cc602c6b54d18656f56d (patch) | |
tree | b04c6b9664ebc676724be4adc854696b0de96701 | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
EDAC, octeon: Fix an uninitialized variable warning
Fix an uninitialized variable warning in the Octeon EDAC driver, as seen
in MIPS cavium_octeon_defconfig builds since v4.14 with Codescape GNU
Tools 2016.05-03:
drivers/edac/octeon_edac-lmc.c In function ‘octeon_lmc_edac_poll_o2’:
drivers/edac/octeon_edac-lmc.c:87:24: warning: ‘((long unsigned int*)&int_reg)[1]’ may \
be used uninitialized in this function [-Wmaybe-uninitialized]
if (int_reg.s.sec_err || int_reg.s.ded_err) {
^
Iinitialise the whole int_reg variable to zero before the conditional
assignments in the error injection case.
Signed-off-by: James Hogan <jhogan@kernel.org>
Acked-by: David Daney <david.daney@cavium.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.15+
Fixes: 1bc021e81565 ("EDAC: Octeon: Add error injection support")
Link: http://lkml.kernel.org/r/20171113161206.20990-1-james.hogan@mips.com
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | drivers/edac/octeon_edac-lmc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/edac/octeon_edac-lmc.c b/drivers/edac/octeon_edac-lmc.c index 9c1ffe3e912b..aeb222ca3ed1 100644 --- a/drivers/edac/octeon_edac-lmc.c +++ b/drivers/edac/octeon_edac-lmc.c | |||
@@ -78,6 +78,7 @@ static void octeon_lmc_edac_poll_o2(struct mem_ctl_info *mci) | |||
78 | if (!pvt->inject) | 78 | if (!pvt->inject) |
79 | int_reg.u64 = cvmx_read_csr(CVMX_LMCX_INT(mci->mc_idx)); | 79 | int_reg.u64 = cvmx_read_csr(CVMX_LMCX_INT(mci->mc_idx)); |
80 | else { | 80 | else { |
81 | int_reg.u64 = 0; | ||
81 | if (pvt->error_type == 1) | 82 | if (pvt->error_type == 1) |
82 | int_reg.s.sec_err = 1; | 83 | int_reg.s.sec_err = 1; |
83 | if (pvt->error_type == 2) | 84 | if (pvt->error_type == 2) |