Re: [PATCH v2 18/21] efi/libstub: use 'func' not 'f' as macro parameter

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

 



On Wed, Dec 18, 2019 at 07:01:36PM +0200, Ard Biesheuvel wrote:
> Use 'func' as the macro parameter name for the efi_call() macros
> which is less likely to collide and cause weird build errors.
> 

For my education, what are the possible collisions/build errors that might happen?

Thanks

> Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
> ---
>  arch/arm64/include/asm/efi.h |  4 ++--
>  arch/x86/include/asm/efi.h   | 12 ++++++------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h
> index 6f041ae446d2..d06305590ac5 100644
> --- a/arch/arm64/include/asm/efi.h
> +++ b/arch/arm64/include/asm/efi.h
> @@ -93,8 +93,8 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base,
>  	return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS_MIN - 1));
>  }
>  
> -#define efi_call_early(f, ...)		efi_system_table()->boottime->f(__VA_ARGS__)
> -#define efi_call_runtime(f, ...)	efi_system_table()->runtime->f(__VA_ARGS__)
> +#define efi_call_early(func, ...)	efi_system_table()->boottime->func(__VA_ARGS__)
> +#define efi_call_runtime(func, ...)	efi_system_table()->runtime->func(__VA_ARGS__)
>  #define efi_is_native()			(true)
>  
>  #define efi_table_attr(inst, attr)	(inst->attr)
> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> index 593a8cda8361..ba3f8a98e156 100644
> --- a/arch/x86/include/asm/efi.h
> +++ b/arch/x86/include/asm/efi.h
> @@ -236,17 +236,17 @@ static inline bool efi_is_native(void)
>  		? inst->func(inst, ##__VA_ARGS__)			\
>  		: efi64_thunk(inst->mixed_mode.func, inst, ##__VA_ARGS__))
>  
> -#define efi_call_early(f, ...)						\
> +#define efi_call_early(func, ...)					\
>  	(efi_is_native()						\
> -		? efi_system_table()->boottime->f(__VA_ARGS__)		\
> +		? efi_system_table()->boottime->func(__VA_ARGS__)	\
>  		: efi64_thunk(efi_table_attr(efi_system_table(),	\
> -				boottime)->mixed_mode.f, __VA_ARGS__))
> +				boottime)->mixed_mode.func, __VA_ARGS__))
>  
> -#define efi_call_runtime(f, ...)					\
> +#define efi_call_runtime(func, ...)					\
>  	(efi_is_native()						\
> -		? efi_system_table()->runtime->f(__VA_ARGS__)		\
> +		? efi_system_table()->runtime->func(__VA_ARGS__)	\
>  		: efi64_thunk(efi_table_attr(efi_system_table(),	\
> -				runtime)->mixed_mode.f, __VA_ARGS__))
> +				runtime)->mixed_mode.func, __VA_ARGS__))
>  
>  extern bool efi_reboot_required(void);
>  extern bool efi_is_table_address(unsigned long phys_addr);
> -- 
> 2.17.1
> 



[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