Skip to content

Commit

Permalink
x86/efi: Deduplicate efi_char16_printk()
Browse files Browse the repository at this point in the history
Eliminate the separate 32-bit and 64x- bit code paths by way of the shiny
new efi_call_proto() macro.

No functional change intended.

Signed-off-by: Lukas Wunner <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
l1k authored and Ingo Molnar committed Feb 1, 2017
1 parent 2bd79f3 commit db4545d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
26 changes: 2 additions & 24 deletions arch/x86/boot/compressed/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,8 @@ efi_open_volume(efi_system_table_t *sys_table, void *__image, void **__fh)

void efi_char16_printk(efi_system_table_t *table, efi_char16_t *str)
{
unsigned long output_string;
size_t offset;

if (efi_early->is64) {
struct efi_simple_text_output_protocol_64 *out;
u64 *func;

offset = offsetof(typeof(*out), output_string);
output_string = efi_early->text_output + offset;
out = (typeof(out))(unsigned long)efi_early->text_output;
func = (u64 *)output_string;

efi_early->call(*func, out, str);
} else {
struct efi_simple_text_output_protocol_32 *out;
u32 *func;

offset = offsetof(typeof(*out), output_string);
output_string = efi_early->text_output + offset;
out = (typeof(out))(unsigned long)efi_early->text_output;
func = (u32 *)output_string;

efi_early->call(*func, out, str);
}
efi_call_proto(efi_simple_text_output_protocol, output_string,
efi_early->text_output, str);
}

static efi_status_t
Expand Down
8 changes: 4 additions & 4 deletions include/linux/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1240,17 +1240,17 @@ struct efivar_entry {
bool deleting;
};

struct efi_simple_text_output_protocol_32 {
typedef struct {
u32 reset;
u32 output_string;
u32 test_string;
};
} efi_simple_text_output_protocol_32_t;

struct efi_simple_text_output_protocol_64 {
typedef struct {
u64 reset;
u64 output_string;
u64 test_string;
};
} efi_simple_text_output_protocol_64_t;

struct efi_simple_text_output_protocol {
void *reset;
Expand Down

0 comments on commit db4545d

Please sign in to comment.