Skip to contentSkip to conversation

x86: mce: add notifier_block forward declaration

PATCH New Arnd Bergmann 2 participants 2 messages Aug 17, 2018 – Aug 20, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: mce: add notifier_block forward declaration

Without linux/irq.h, we don't see a declaration of notifier_block, leading to a build warning:

In file included from arch/x86/kernel/cpu/mcheck/threshold.c:10:
arch/x86/include/asm/mce.h:151:46: error: 'struct notifier_block' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

It's sufficient to declare the struct tag here, which avoids pulling in more header files.

Fixes 447ae3166702 ("x86: Don't include linux/irq.h from asm/hardirq.h")
---
 arch/x86/include/asm/mce.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/mce.h +1 -0
index 8c7b3e5a2d01..3a17107594c8 100644
@@ -148,6 +148,7 @@ enum mce_notifier_prios {
 	MCE_PRIO_LOWEST		= 0,
 };
 
+struct notifier_block;
 extern void mce_register_decode_chain(struct notifier_block *nb);
 extern void mce_unregister_decode_chain(struct notifier_block *nb);
 
Signature · 1 line
2.18.0
#1 lore raw

[tip:x86/urgent] x86/mce: Add notifier_block forward declaration

x86/mce: Add notifier_block forward declaration
Commit-ID:  704ae091b061082b37a9968621af4c290c641d50
Gitweb:     https://git.kernel.org/tip/704ae091b061082b37a9968621af4c290c641d50
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Fri, 17 Aug 2018 12:01:36 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 20 Aug 2018 18:04:42 +0200

x86/mce: Add notifier_block forward declaration

Without linux/irq.h, there is no declaration of notifier_block, leading to a build warning:

In file included from arch/x86/kernel/cpu/mcheck/threshold.c:10:
arch/x86/include/asm/mce.h:151:46: error: 'struct notifier_block' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

It's sufficient to declare the struct tag here, which avoids pulling in more header files.

Fixes 447ae3166702 ("x86: Don't include linux/irq.h from asm/hardirq.h")
Cc Nicolai Stange <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 arch/x86/include/asm/mce.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/mce.h +1 -0
index 8c7b3e5a2d01..3a17107594c8 100644
@@ -148,6 +148,7 @@ enum mce_notifier_prios {
 	MCE_PRIO_LOWEST		= 0,
 };
 
+struct notifier_block;
 extern void mce_register_decode_chain(struct notifier_block *nb);
 extern void mce_unregister_decode_chain(struct notifier_block *nb);