Skip to contentSkip to conversation

efi: fix missing prototype warnings

PATCH In review Arnd Bergmann 2 participants 2 messages May 16, 2023 – May 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: fix missing prototype warnings

From: Arnd Bergmann <[email protected]>

The cper.c file needs to include an extra header, and efi_zboot_entry needs an extern declaration to avoid these 'make W=1' warnings:

drivers/firmware/efi/libstub/zboot.c:65:1: error: no previous prototype for 'efi_zboot_entry' [-Werror=missing-prototypes] drivers/firmware/efi/efi.c:176:16: error: no previous prototype for 'efi_attr_is_visible' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:626:6: error: no previous prototype for 'cper_estatus_print' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:649:5: error: no previous prototype for 'cper_estatus_check_header' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:662:5: error: no previous prototype for 'cper_estatus_check' [-Werror=missing-prototypes]

---
 drivers/firmware/efi/cper.c            | 1 +
 drivers/firmware/efi/libstub/efistub.h | 3 +++
 include/linux/efi.h                    | 2 ++
 3 files changed, 6 insertions(+)
drivers/firmware/efi/cper.c +1 -0
index 35c37f667781..75715c7be34a 100644
@@ -25,6 +25,7 @@
 #include <acpi/ghes.h>
 #include <ras/ras_event.h>
 #include "cper_cxl.h"
+#include "../../acpi/apei/apei-internal.h"
 
 /*
  * CPER record ID need to be unique even after reboot, because record
drivers/firmware/efi/libstub/efistub.h +3 -0
index 67d5a20802e0..54a2822cae77 100644
@@ -1133,4 +1133,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
 void efi_remap_image(unsigned long image_base, unsigned alloc_size,
 		     unsigned long code_size);
 
+asmlinkage efi_status_t __efiapi
+efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab);
+
 #endif
include/linux/efi.h +2 -0
index 7aa62c92185f..571d1a6e1b74 100644
@@ -1338,4 +1338,6 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table)
 	return xen_efi_config_table_is_usable(guid, table);
 }
 
+umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
+
 #endif /* _LINUX_EFI_H */
Signature · 1 line
2.39.2
maintainer
#1 lore raw
Quoted 25 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The cper.c file needs to include an extra header, and efi_zboot_entry needs an extern declaration to avoid these 'make W=1' warnings:

drivers/firmware/efi/libstub/zboot.c:65:1: error: no previous prototype for 'efi_zboot_entry' [-Werror=missing-prototypes] drivers/firmware/efi/efi.c:176:16: error: no previous prototype for 'efi_attr_is_visible' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:626:6: error: no previous prototype for 'cper_estatus_print' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:649:5: error: no previous prototype for 'cper_estatus_check_header' [-Werror=missing-prototypes] drivers/firmware/efi/cper.c:662:5: error: no previous prototype for 'cper_estatus_check' [-Werror=missing-prototypes]

---
 drivers/firmware/efi/cper.c            | 1 +
 drivers/firmware/efi/libstub/efistub.h | 3 +++
 include/linux/efi.h                    | 2 ++
 3 files changed, 6 insertions(+)
drivers/firmware/efi/cper.c +0 -0
index 35c37f667781..75715c7be34a 100644

drivers/firmware/efi/cper.c line 28

Quoted 4 lines
drivers/firmware/efi/cper.c +1 -0
@@ -25,6 +25,7 @@
 #include <acpi/ghes.h>
 #include <ras/ras_event.h>
 #include "cper_cxl.h"
+#include "../../acpi/apei/apei-internal.h"

Yuck. Could we move the missing definitions to linux/cper.h instead?

Quoted 29 lines
drivers/firmware/efi/cper.c +0 -0
 /*
  * CPER record ID need to be unique even after reboot, because record
drivers/firmware/efi/libstub/efistub.h +3 -0
index 67d5a20802e0..54a2822cae77 100644
@@ -1133,4 +1133,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
 void efi_remap_image(unsigned long image_base, unsigned alloc_size,
                     unsigned long code_size);
 
+asmlinkage efi_status_t __efiapi
+efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab);
+
 #endif
include/linux/efi.h +2 -1
index 7aa62c92185f..571d1a6e1b74 100644
@@ -1338,4 +1338,6 @@ bool efi_config_table_is_usable(const efi_guid_t *guid, unsigned long table)
        return xen_efi_config_table_is_usable(guid, table);
 }
 
+umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
+
 #endif /* _LINUX_EFI_H */
--

2.39.2