Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399688

Re: [PATCH 1/2] Create UV efi_call macros

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] Create UV efi_call macros
Date 2016-05-12 08:50 +0200
Message-ID <rxSBz-im-3@gated-at.bofh.it> (permalink)
References <rxIsy-6D9-3@gated-at.bofh.it> <rxIsy-6D9-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Alex Thorlton <athorlton@sgi.com> wrote:

> +#define efi_call_virt(f, args...)					\
> +({									\
> +	efi_status_t __s;						\
> +	unsigned long flags;						\
> +	arch_efi_call_virt_setup();					\
> +	local_save_flags(flags);					\
> +	__s = arch_efi_call_virt(f, args);				\
> +	efi_call_virt_check_flags(flags, __stringify(f));		\
> +	arch_efi_call_virt_teardown();					\
> +	__s;								\
> +})
> +
> +#define __efi_call_virt(f, args...)					\
> +({									\
> +	unsigned long flags;						\
> +	arch_efi_call_virt_setup();					\
> +	local_save_flags(flags);					\
> +	arch_efi_call_virt(f, args);					\
> +	efi_call_virt_check_flags(flags, __stringify(f));		\
> +	arch_efi_call_virt_teardown();					\
> +})
> +
> +#define uv_call_virt(f, args...)					\
> +({									\
> +	efi_status_t __s;						\
> +	unsigned long flags;						\
> +	arch_efi_call_virt_setup();					\
> +	local_save_flags(flags);					\
> +	__s = uv_efi_call_virt(f, args);				\
> +	efi_call_virt_check_flags(flags, __stringify(f));		\
> +	arch_efi_call_virt_teardown();					\
> +	__s;								\
> +})

Btw., a very (very!) small stylistic nit that caught my eyes, and I realize that 
you just moved code, but could you please improve these macros a bit and make it 
look like regular kernel code? I.e. something like:

#define efi_call_virt(f, args...)					\
({									\
	efi_status_t __s;						\
	unsigned long flags;						\
									\
	arch_efi_call_virt_setup();					\
									\
	local_save_flags(flags);					\
	__s = arch_efi_call_virt(f, args);				\
	efi_call_virt_check_flags(flags, __stringify(f));		\
	arch_efi_call_virt_teardown();					\
									\
	__s;								\
})

This delineates the various blocks of code: variables, setup, the saving/calling 
block plus the return code.

(Assuming the EFI folks like the whole approach.)

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] Create UV efi_call macros Alex Thorlton <athorlton@sgi.com> - 2016-05-11 22:00 +0200
  Re: [PATCH 1/2] Create UV efi_call macros Ingo Molnar <mingo@kernel.org> - 2016-05-12 08:50 +0200
    Re: [PATCH 1/2] Create UV efi_call macros Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-05-12 09:40 +0200
      Re: [PATCH 1/2] Create UV efi_call macros Ingo Molnar <mingo@kernel.org> - 2016-05-12 10:20 +0200
        Re: [PATCH 1/2] Create UV efi_call macros Alex Thorlton <athorlton@sgi.com> - 2016-05-17 01:10 +0200
  Re: [PATCH 1/2] Create UV efi_call macros Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-12 14:10 +0200
    Re: [PATCH 1/2] Create UV efi_call macros Alex Thorlton <athorlton@sgi.com> - 2016-05-17 01:00 +0200
      Re: [PATCH 1/2] Create UV efi_call macros Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-17 14:20 +0200
        Re: [PATCH 1/2] Create UV efi_call macros Alex Thorlton <athorlton@sgi.com> - 2016-05-17 22:20 +0200

csiph-web