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>,
Ard Biesheuvel <ardb@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Jose Marinho <jose.marinho@arm.com>
Subject: [PATCH 1/3] arm64: efi: Simplify arch_efi_call_virt macro by not using efi_##f##_t type
Date: Fri, 24 Jun 2022 16:23:29 +0100 [thread overview]
Message-ID: <20220624152331.4009502-2-sudeep.holla@arm.com> (raw)
In-Reply-To: <20220624152331.4009502-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 typecasting p->f to (void *)
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 | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Hi Ard,
I am not sure if you prefer to add type for each users of this or this
is acceptable. I see only compile time advantage but I am not sure if
it make sense to add typedefs in ACPI PRMT driver just for this reason.
Let me know.
Regards,
Sudeep
diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h
index ad55079abe47..263d7fd67207 100644
--- a/arch/arm64/include/asm/efi.h
+++ b/arch/arm64/include/asm/efi.h
@@ -29,9 +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; \
- __efi_rt_asm_wrapper(__f, #f, args); \
+ __efi_rt_asm_wrapper((void *)p->f, #f, args); \
})
#define arch_efi_call_virt_teardown() \
--
2.36.1
next prev parent reply other threads:[~2022-06-24 15:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 15:23 [PATCH 0/3] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Sudeep Holla
2022-06-24 15:23 ` Sudeep Holla [this message]
2022-06-24 17:45 ` [PATCH 1/3] arm64: efi: Simplify arch_efi_call_virt macro by not using efi_##f##_t type Ard Biesheuvel
2022-06-25 10:10 ` Sudeep Holla
2022-06-25 16:01 ` Ard Biesheuvel
2022-06-24 15:23 ` [PATCH 2/3] ACPI: Enable Platform Runtime Mechanism(PRM) support on ARM64 Sudeep Holla
2022-06-24 17:41 ` Ard Biesheuvel
2022-06-24 15:23 ` [PATCH 3/3] ACPI: Move PRM config option under the main ACPI config Sudeep Holla
2022-06-24 17:42 ` 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=20220624152331.4009502-2-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