public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: efi: Simplify arch_efi_call_virt() macro by using typeof()
@ 2022-06-28 12:59 Sudeep Holla
  2022-06-28 13:16 ` Ard Biesheuvel
  0 siblings, 1 reply; 9+ messages in thread
From: Sudeep Holla @ 2022-06-28 12:59 UTC (permalink / raw)
  To: linux-arm-kernel, linux-efi; +Cc: Sudeep Holla, Ard Biesheuvel, Russell King

Currently, the arch_efi_call_virt() assumes all users of it will have
defined a type 'efi_##f##_t' to make use of it. It is unnecessarily
forcing the users to create a new typedef when __efi_rt_asm_wrapper()
actually expects void pointer.

Simplify the arch_efi_call_virt() macro by using typeof(p->f) which must
be a pointer as required by __efi_rt_asm_wrapper() and eliminate the
explicit need for efi_##f##_t type for every user of this macro.

This change is done to align with implementations on other similar
architectures.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm/include/asm/efi.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Hi,

Reference for this change [1] and in particular[2]

Regards,
Sudeep

[1] https://lore.kernel.org/r/20220628125346.693304-1-sudeep.holla@arm.com
[2] https://lore.kernel.org/r/20220628125346.693304-3-sudeep.holla@arm.com/

diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h
index 27218eabbf9a..d4a405c9b4b6 100644
--- a/arch/arm/include/asm/efi.h
+++ b/arch/arm/include/asm/efi.h
@@ -26,8 +26,7 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
 
 #define arch_efi_call_virt(p, f, args...)				\
 ({									\
-	efi_##f##_t *__f;						\
-	__f = p->f;							\
+	typeof(p->f) __f = p->f;					\
 	__f(args);							\
 })
 
-- 
2.37.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-29  9:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-28 12:59 [PATCH] ARM: efi: Simplify arch_efi_call_virt() macro by using typeof() Sudeep Holla
2022-06-28 13:16 ` Ard Biesheuvel
2022-06-28 13:47   ` Sudeep Holla
2022-06-28 13:57     ` Ard Biesheuvel
2022-06-28 14:09       ` Sudeep Holla
2022-06-28 17:58         ` Ard Biesheuvel
2022-06-29  8:56           ` Sudeep Holla
2022-06-29  8:58             ` Ard Biesheuvel
2022-06-29  9:02               ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox