[PATCH 4.18 04/79] x86/irqflags: Provide a declaration for native_save_fl

From: Greg Kroah-Hartman
Date: Tue Aug 14 2018 - 13:25:24 EST


4.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>

commit 208cbb32558907f68b3b2a081ca2337ac3744794 upstream.

It was reported that the commit d0a8d9378d16 is causing users of gcc < 4.9
to observe -Werror=missing-prototypes errors.

Indeed, it seems that:
extern inline unsigned long native_save_fl(void) { return 0; }

compiled with -Werror=missing-prototypes produces this warning in gcc <
4.9, but not gcc >= 4.9.

Fixes: d0a8d9378d16 ("x86/paravirt: Make native_save_fl() extern inline").
Reported-by: David Laight <david.laight@xxxxxxxxxx>
Reported-by: Jean Delvare <jdelvare@xxxxxxx>
Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: hpa@xxxxxxxxx
Cc: jgross@xxxxxxxx
Cc: kstewart@xxxxxxxxxxxxxxxxxxx
Cc: gregkh@xxxxxxxxxxxxxxxxxxx
Cc: boris.ostrovsky@xxxxxxxxxx
Cc: astrachan@xxxxxxxxxx
Cc: mka@xxxxxxxxxxxx
Cc: arnd@xxxxxxxx
Cc: tstellar@xxxxxxxxxx
Cc: sedat.dilek@xxxxxxxxx
Cc: David.Laight@xxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx
Link: https://lkml.kernel.org/r/20180803170550.164688-1-ndesaulniers@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
arch/x86/include/asm/irqflags.h | 2 ++
1 file changed, 2 insertions(+)

--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -13,6 +13,8 @@
* Interrupt control:
*/

+/* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */
+extern inline unsigned long native_save_fl(void);
extern inline unsigned long native_save_fl(void)
{
unsigned long flags;