From patchwork Fri Jun 24 15:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 584698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5674ECCA481 for ; Fri, 24 Jun 2022 15:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231530AbiFXPXs (ORCPT ); Fri, 24 Jun 2022 11:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbiFXPXr (ORCPT ); Fri, 24 Jun 2022 11:23:47 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0148E47042; Fri, 24 Jun 2022 08:23:46 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F274E143D; Fri, 24 Jun 2022 08:23:45 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A00FC3F534; Fri, 24 Jun 2022 08:23:44 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: Sudeep Holla , Ard Biesheuvel , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Jose Marinho 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 Message-Id: <20220624152331.4009502-2-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624152331.4009502-1-sudeep.holla@arm.com> References: <20220624152331.4009502-1-sudeep.holla@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- 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() \