Skip to content

Commit

Permalink
efi: fix missing prototype warnings
Browse files Browse the repository at this point in the history
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]

To make this easier, move the cper specific declarations to
include/linux/cper.h.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Ard Biesheuvel committed May 25, 2023
1 parent 095aabe commit fd936fd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/acpi/apei/apei-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef APEI_INTERNAL_H
#define APEI_INTERNAL_H

#include <linux/cper.h>
#include <linux/acpi.h>

struct apei_exec_context;
Expand Down Expand Up @@ -130,10 +129,5 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
return sizeof(*estatus) + estatus->data_length;
}

void cper_estatus_print(const char *pfx,
const struct acpi_hest_generic_status *estatus);
int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int cper_estatus_check(const struct acpi_hest_generic_status *estatus);

int apei_osc_setup(void);
#endif
1 change: 1 addition & 0 deletions drivers/acpi/apei/bert.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/cper.h>
#include <linux/io.h>

#include "apei-internal.h"
Expand Down
3 changes: 3 additions & 0 deletions drivers/firmware/efi/libstub/efistub.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions include/linux/cper.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,10 @@ void cper_print_proc_ia(const char *pfx,
int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg);
int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg);

struct acpi_hest_generic_status;
void cper_estatus_print(const char *pfx,
const struct acpi_hest_generic_status *estatus);
int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int cper_estatus_check(const struct acpi_hest_generic_status *estatus);

#endif
2 changes: 2 additions & 0 deletions include/linux/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit fd936fd

Please sign in to comment.