From patchwork Tue Jun 28 14:18:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12898375 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58BC1C43334 for ; Tue, 28 Jun 2022 14:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ctUS4uV0VyuY1rhCTlAhm+fz2vVJWgy9T3o0R7/WHUY=; b=uDmFhslrnLRHND XaYybc+W+kLRLLWVufhTt+495ef/kBGAEYhiuI0fonzH9XS46V5srzarlHWDSU4AJCmttk4mGz4qK 9YVCA8gTvNGo3ajCfMkSNvRXRibtZjc4CU1cJ3Vkn4uRdbsRAv+No0ar0sikYUgHxkqp1FGLf8Azg nFcKcFVKoofOlYCGdFMS1a2tfXHJOpAZOMTcZnhdZyWVDMYDz4BKtSTNx2DIUMHeLbXMyYB40rOyW tMf55VJObfr8SdhnqmuLrk0hBnlGV3nS1osLxUtV5ay6gUYwzk+AxZs2u41kHPgQOcrNCMXZ4WGuP EecfHBxW/pqg61rVWCDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6C2u-006g70-IW; Tue, 28 Jun 2022 14:18:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6C2r-006g68-7R for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 14:18:26 +0000 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 1EF981477; Tue, 28 Jun 2022 07:18:24 -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 270263F5A1; Tue, 28 Jun 2022 07:18:23 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: Sudeep Holla , Ard Biesheuvel , Russell King Subject: [PATCH v2] ARM: efi: Simplify arch_efi_call_virt() macro Date: Tue, 28 Jun 2022 15:18:21 +0100 Message-Id: <20220628141821.849643-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_071825_356635_C7E5E62F X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 eliminating 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 Cc: Russell King Signed-off-by: Sudeep Holla Acked-by: Russell King (Oracle) --- arch/arm/include/asm/efi.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) v1[1]->v2: - Dropped the usage of even typeof() and simply call p->f(args) as suggested by Ard [1] https://lore.kernel.org/r/20220628125938.694256-1-sudeep.holla@arm.com/ diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index 27218eabbf9a..bb4d15101de4 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h @@ -24,12 +24,7 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); #define arch_efi_call_virt_setup() efi_virtmap_load() #define arch_efi_call_virt_teardown() efi_virtmap_unload() -#define arch_efi_call_virt(p, f, args...) \ -({ \ - efi_##f##_t *__f; \ - __f = p->f; \ - __f(args); \ -}) +#define arch_efi_call_virt(p, f, args...) ((p)->f(args)) #define ARCH_EFI_IRQ_FLAGS_MASK \ (PSR_J_BIT | PSR_E_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT | \