x86: quirks: hide maybe-uninitialized warning
PATCH 1/1 x86: quirks: hide maybe-uninitialized warning
gcc -Wmaybe-uninitialized detects that quirk_intel_brickland_xeon_ras_cap uses uninitialized data when CONFIG_PCI is not set:
arch/x86/kernel/quirks.c: In function ‘quirk_intel_brickland_xeon_ras_cap’:arch/x86/kernel/quirks.c:641:13: error: ‘capid0’ is used uninitialized in this function [-Werror=uninitialized]
However, the function is also not called in this configuration, so we can avoid the warning by moving the existing #ifdef to cover it as well.
--- arch/x86/kernel/quirks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kernel/quirks.c +1 -2
@@ -625,8 +625,6 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev)DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_16H_NB_F3 , amd_disable_seq_and_redirect_scrub); -#endif -#if defined(CONFIG_X86_64 ) && defined(CONFIG_X86_MCE )#include <linux/jump_label.h> #include <asm/string_64.h>
@@ -657,3 +655,4 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x6fc0 , quirk_intel_brickland_xeon_ras_cap);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x2083 , quirk_intel_purley_xeon_ras_cap);#endif +#endif
Signature · 1 line
2.9.0
tip-bot for Arnd Bergmann
merge bot[tip:x86/urgent] x86/quirks: Hide maybe-uninitialized warning
x86/quirks: Hide maybe-uninitialized warning
Commit-ID: d320b9a5bd85f6178cc3ed8b0a1a9960f2b5bc7b Gitweb: http://git.kernel.org/tip/d320b9a5bd85f6178cc3ed8b0a1a9960f2b5bc7b Author: Arnd Bergmann <[email protected]> AuthorDate: Mon, 24 Oct 2016 17:33:18 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 25 Oct 2016 11:45:13 +0200
x86/quirks: Hide maybe-uninitialized warning
gcc -Wmaybe-uninitialized detects that quirk_intel_brickland_xeon_ras_cap uses uninitialized data when CONFIG_PCI is not set:
arch/x86/kernel/quirks.c: In function ‘quirk_intel_brickland_xeon_ras_cap’:
arch/x86/kernel/quirks.c:641:13: error: ‘capid0’ is used uninitialized in this function [-Werror=uninitialized]
However, the function is also not called in this configuration, so we can avoid the warning by moving the existing #ifdef to cover it as well.
--- arch/x86/kernel/quirks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kernel/quirks.c +1 -2
@@ -625,8 +625,6 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev)DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_16H_NB_F3 , amd_disable_seq_and_redirect_scrub); -#endif -#if defined(CONFIG_X86_64 ) && defined(CONFIG_X86_MCE )#include <linux/jump_label.h> #include <asm/string_64.h>
@@ -657,3 +655,4 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x6fc0 , quirk_intel_brickland_xeon_ras_cap);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x2083 , quirk_intel_purley_xeon_ras_cap);#endif +#endif
Quoted 10 lines · Arnd Bergmann
gcc -Wmaybe-uninitialized detects that
quirk_intel_brickland_xeon_ras_capuses uninitialized data whenCONFIG_PCIis not set:
arch/x86/kernel/quirks.c: In function ‘quirk_intel_brickland_xeon_ras_cap’:arch/x86/kernel/quirks.c:641:13: error: ‘capid0’ is used uninitialized in this function [-Werror=uninitialized]However, the function is also not called in this configuration, so we can avoid the warning by moving the existing #ifdef to cover it as well.
Signed-off-by Arnd Bergmann <[email protected]>
This fixes 3637efb00864 ("x86/mce: Add PCI quirks to identify Xeons with machine check recovery"), which appeared in v4.9-rc1. I assume it will be merged for v4.9 via the x86 tree, as 3637efb00864 was.
Quoted 29 lines
--- arch/x86/kernel/quirks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/x86/kernel/quirks.c +1
-2@@ -625,8 +625,6 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev)DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_16H_NB_F3 , amd_disable_seq_and_redirect_scrub); -#endif -#if defined(CONFIG_X86_64 ) && defined(CONFIG_X86_MCE )#include <linux/jump_label.h> #include <asm/string_64.h> @@ -657,3 +655,4 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x6fc0 , quirk_intel_brickland_xeon_ras_cap);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x2083 , quirk_intel_purley_xeon_ras_cap);#endif +#endif Signature · 6 lines
2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Bjorn Helgaas
Quoted 9 lines · Arnd Bergmann
gcc -Wmaybe-uninitialized detects that
quirk_intel_brickland_xeon_ras_capuses uninitialized data whenCONFIG_PCIis not set:
arch/x86/kernel/quirks.c: In function ‘quirk_intel_brickland_xeon_ras_cap’:arch/x86/kernel/quirks.c:641:13: error: ‘capid0’ is used uninitialized in this function [-Werror=uninitialized]However, the function is also not called in this configuration, so we can avoid the warning by moving the existing #ifdef to cover it as well.
Quoted 7 lines
Quoted 1 line
Signed-off-by Arnd Bergmann <[email protected]>This fixes
3637efb00864("x86/mce: Add PCI quirks to identify Xeons with machine check recovery"), which appeared in v4.9-rc1. I assume it will be merged for v4.9 via the x86 tree, as3637efb00864was.Acked-by Bjorn Helgaas <[email protected]>
Yeah, that's the plan - thanks!
Ingo