Skip to contentSkip to conversation

efi: x86/xen: fix -Wmissing-prototypes warning

PATCH In review maqiang 2 participants 2 messages Mar 3, 2021

Subsystems (2)
lore
Share & tools
lore

maqiang

author
#0 lore raw

PATCH 1/1 efi: x86/xen: fix -Wmissing-prototypes warning

We get 1 warning when building kernel with W=1:
arch/x86/xen/efi.c:130:13: warning:
no previous prototype for ‘xen_efi_init’ [-Wmissing-prototypes] void __init xen_efi_init(struct boot_params *boot_params)

In fact, this function is declared as a static inline function in header file, but is not decorated as a static inline function in source file.
So this patch marks this function with 'static inline'.

---
 arch/x86/xen/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/efi.c +1 -1
index 7d7ffb9c826a..cf2e9ff3866d 100644
@@ -127,7 +127,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 	return efi_secureboot_mode_enabled;
 }
 
-void __init xen_efi_init(struct boot_params *boot_params)
+static inline void __init xen_efi_init(struct boot_params *boot_params)
 {
 	efi_system_table_t *efi_systab_xen;
 
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 20 lines · maqiang

We get 1 warning when building kernel with W=1:
arch/x86/xen/efi.c:130:13: warning:
no previous prototype for ‘xen_efi_init’ [-Wmissing-prototypes] void __init xen_efi_init(struct boot_params *boot_params)

In fact, this function is declared as a static inline function in header file, but is not decorated as a static inline function in source file.
So this patch marks this function with 'static inline'.

---
  arch/x86/xen/efi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/efi.c +0 -0
index 7d7ffb9c826a..cf2e9ff3866d 100644

arch/x86/xen/efi.c static enum efi_secureboot_mode xen_efi_get_secureboot(void) · line 130

Quoted 5 lines
arch/x86/xen/efi.c +1 -1
@@ -127,7 +127,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
  	return efi_secureboot_mode_enabled;
  }
 
-void __init xen_efi_init(struct boot_params *boot_params)
+static inline void __init xen_efi_init(struct boot_params *boot_params)

This is an absolutely wrong "fix". You are breaking a normal build as xen_efi_init() will no longer be callable from other sources.

Juergen