public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-efi@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Jose Marinho <jose.marinho@arm.com>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH v2 2/4] arm64: efi: Simplify arch_efi_call_virt() macro by using typeof()
Date: Tue, 28 Jun 2022 13:53:44 +0100	[thread overview]
Message-ID: <20220628125346.693304-3-sudeep.holla@arm.com> (raw)
In-Reply-To: <20220628125346.693304-1-sudeep.holla@arm.com>

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 is needed now in preparation to enable PRMT support on ARM64.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm64/include/asm/efi.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h
index ad55079abe47..53376cdab175 100644
--- a/arch/arm64/include/asm/efi.h
+++ b/arch/arm64/include/asm/efi.h
@@ -29,8 +29,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;					\
 	__efi_rt_asm_wrapper(__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

  parent reply	other threads:[~2022-06-28 12:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 12:53 [PATCH v2 0/4] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Sudeep Holla
2022-06-28 12:53 ` [PATCH v2 1/4] ACPI: PRM: Change handler_addr type to void pointer Sudeep Holla
2022-06-28 17:06   ` Ard Biesheuvel
2022-06-28 12:53 ` Sudeep Holla [this message]
2022-06-28 17:10   ` [PATCH v2 2/4] arm64: efi: Simplify arch_efi_call_virt() macro by using typeof() Ard Biesheuvel
2022-06-28 12:53 ` [PATCH v2 3/4] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Sudeep Holla
2022-06-28 17:11   ` Ard Biesheuvel
2022-06-28 12:53 ` [PATCH v2 4/4] ACPI: Move PRM config option under the main ACPI config Sudeep Holla
2022-06-28 17:11   ` Ard Biesheuvel
2022-06-29  9:06 ` [PATCH v2 0/4] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Sudeep Holla
2022-06-29  9:21   ` Sudeep Holla
2022-06-29 19:12     ` Rafael J. Wysocki
2022-06-30 13:02       ` Sudeep Holla
2022-06-30 15:36         ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220628125346.693304-3-sudeep.holla@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=jose.marinho@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox