]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
EDAC, octeon: Fix an uninitialized variable warning
authorJames Hogan <jhogan@kernel.org>
Mon, 13 Nov 2017 16:12:06 +0000 (16:12 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 22 Feb 2018 14:21:53 +0000 (08:21 -0600)
commit578240487e6008b819c86f33d152c31404f91eff
treeca1e302271a8b170897dce7fc429c5e35a7bc2d2
parent19cc72a42729a70f218007e4b8cf6b107b55609d
EDAC, octeon: Fix an uninitialized variable warning

BugLink: http://bugs.launchpad.net/bugs/1751064
commit 544e92581a2ac44607d7cc602c6b54d18656f56d upstream.

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
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/edac/octeon_edac-lmc.c