Re: [PATCH 06/13] x86/efi: Build our own EFI services pointer table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/27/2014 11:50 AM, Matt Fleming wrote:
> diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
> index a7677babf946..932e01c37550 100644
> --- a/arch/x86/boot/compressed/eboot.c
> +++ b/arch/x86/boot/compressed/eboot.c
> @@ -19,10 +19,171 @@
>  
>  static efi_system_table_t *sys_table;
>  
> +static struct efi_config *efi_early;
> +
> +#define BOOT_SERVICES(bits)						\
> +static void setup_boot_services##bits(struct efi_config *c)		\
> +{									\
> +	u##bits table, *bt, *func;					\
> +	size_t off;							\
> +									\
> +	table = (typeof(table))(unsigned long)sys_table;		\
> +									\
> +	off = offsetof(efi_system_table_##bits##_t, con_out);		\
> +	func = (typeof(func))(unsigned long)(table + off);		\
> +	c->text_output = *func;						\

Since you are macroizing this anyway, do you notice how often this
particular stanza or some variant thereof is repeated?  It really seems
like it should make a good macro and make the code a lot more readable.

That being said, is there a reason we can't simply write this as:

	efi_system_table_##bits##_t table;

	/* ... */

	func = (typeof(func))(unsigned long)table->con_out;
	c->text_output = *func;

	(which could still be turned into a macro perhaps?)

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux