Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline

From: Greg Kroah-Hartman
Date: Tue Aug 28 2018 - 01:13:09 EST


On Mon, Aug 27, 2018 at 02:40:09PM -0700, Nick Desaulniers wrote:
> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
> native_save_fl")
>
> This should have been marked extern inline in order to pick up the out
> of line definition in arch/x86/kernel/irqflags.S.
>
> Cc: stable@xxxxxxxxxxxxxxx # 4.18, 4.14, 4.9, 4.4
> Reported-by: Ben Hutchings <ben.hutchings@xxxxxxxxxxxxxxx>
> Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> ---
> arch/x86/include/asm/irqflags.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
> index c14f2a74b2be..15450a675031 100644
> --- a/arch/x86/include/asm/irqflags.h
> +++ b/arch/x86/include/asm/irqflags.h
> @@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
> return flags;
> }
>
> -static inline void native_restore_fl(unsigned long flags)
> +extern inline void native_restore_fl(unsigned long flags);
> +extern inline void native_restore_fl(unsigned long flags)

This looks odd to me, but my coffee hasn't kicked in yet this morning.
Why do you need both lines here? Shouldn't the actual function be
sufficient? If not, a comment explaining this would be nice.

thanks,

greg k-h