Skip to content

Commit c4c39c7

Browse files
Ard BiesheuvelIngo Molnar
authored andcommitted
efi: Use typed function pointers for the runtime services table
Instead of using void pointers, and casting them to correctly typed function pointers upon use, declare the runtime services pointers as function pointers using their respective prototypes, for which typedefs are already available. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1485868902-20401-8-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent e668808 commit c4c39c7

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

include/linux/efi.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -509,24 +509,6 @@ typedef struct {
509509
u64 query_variable_info;
510510
} efi_runtime_services_64_t;
511511

512-
typedef struct {
513-
efi_table_hdr_t hdr;
514-
void *get_time;
515-
void *set_time;
516-
void *get_wakeup_time;
517-
void *set_wakeup_time;
518-
void *set_virtual_address_map;
519-
void *convert_pointer;
520-
void *get_variable;
521-
void *get_next_variable;
522-
void *set_variable;
523-
void *get_next_high_mono_count;
524-
void *reset_system;
525-
void *update_capsule;
526-
void *query_capsule_caps;
527-
void *query_variable_info;
528-
} efi_runtime_services_t;
529-
530512
typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
531513
typedef efi_status_t efi_set_time_t (efi_time_t *tm);
532514
typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending,
@@ -561,6 +543,24 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes,
561543
unsigned long size,
562544
bool nonblocking);
563545

546+
typedef struct {
547+
efi_table_hdr_t hdr;
548+
efi_get_time_t *get_time;
549+
efi_set_time_t *set_time;
550+
efi_get_wakeup_time_t *get_wakeup_time;
551+
efi_set_wakeup_time_t *set_wakeup_time;
552+
efi_set_virtual_address_map_t *set_virtual_address_map;
553+
void *convert_pointer;
554+
efi_get_variable_t *get_variable;
555+
efi_get_next_variable_t *get_next_variable;
556+
efi_set_variable_t *set_variable;
557+
efi_get_next_high_mono_count_t *get_next_high_mono_count;
558+
efi_reset_system_t *reset_system;
559+
efi_update_capsule_t *update_capsule;
560+
efi_query_capsule_caps_t *query_capsule_caps;
561+
efi_query_variable_info_t *query_variable_info;
562+
} efi_runtime_services_t;
563+
564564
void efi_native_runtime_setup(void);
565565

566566
/*

0 commit comments

Comments
 (0)