From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755893AbcAHWEW (ORCPT ); Fri, 8 Jan 2016 17:04:22 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:50843 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754288AbcAHWEU (ORCPT ); Fri, 8 Jan 2016 17:04:20 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: ard.biesheuvel@linaro.org, Russell King , linux-kernel@vger.kernel.org, Matt Fleming , Will Deacon Subject: [PATCH] ARM: turn init_new_context into an inline function Date: Fri, 08 Jan 2016 23:03:49 +0100 Message-ID: <16176240.edsgIdRrJJ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:WCJhvMYgFR2S/Hgxz31GSxoaOL8X0qTU0swYh/NWuXLJT74Fdbb /bAO2prmICvAax67RPEABguFOdGnbHpwv+2l0bz5Sp9i3Mzaej0m1SGf7WcRW/UGuBFIFLZ JquOZFJfloPQ1WOW0QcfQlpbR5g2Sq//XZ7j3xrOjMNRwyPTgV0XQGMGyOPbLc7A4ljMpcx VndXliR625nGT6Sb62nUQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:mGFMVyX1FIU=:WRSPbjX+Qvzq8SWNfZGHay 6f5GZL+QOoznK+3KW8MpKartiuyBDkqHEf5P453yA+Lxx/QAX0eQSWG/7Ufh5FcB22oLTXNTN qLRsZEWd7tEl3A7PQfLnQNq5SLs7zuyJ0ymNefeT95PU6bxcYT8QK/fsbmQFbui0KfTZnwppY K6Rvo/ApJqPEwtmMaje++AR/RDaPOr6Je9kRiBTmmbPZySOOgHKOUowQk5zLTluyz9S/lvjNc IKVW1+ZQWIFmQofjSRpYaxEkaf4CusxtaCPKR7Mz+kAEhc4jKHIr76pSUahcsw+KjHy4r+D/I 57+xdzTNweZ8Ok5/TjVZGztcSPHTYzLLaoyUynXTGn4t2sOn6sv7kEO8lFM9qDYi5t/aaVcwp 7qFQyY4e7krYsp1DcFKlow80QXq7N3sWhvJJr9GEJjDpRx/qUnkboGpd4JcqMYU9OSJRHhoRc rNpdb3GobrUKzsJ57IDIzqYZyCaI3GW+yL4/ZodUnxCuGV99uWwV0sAyBSfy6oagPczxyi2Ka IZIFCeIEnb+h64q1E+aMFCjeC6wXcrlOKOwqUfLFPr0aN0pMWYIq98hZyjXbDM1GCA+gpk1UJ CIayfiRtRMi4jrD/5UDDP3knSpgH6L7cI9VkWimAAGsc6eP92HdGQm40SAB9ayZOVaoxdN1sw wzSnGfA16PZ5O7j34eqMQadI8E49UJ/FkNLIiOIG5osWsEYqFkAa2vNKuWW4NlPEdEu5NqsoD FAbeiXEOHN4ACR3O Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Almost all architectures define init_new_context() as a function, but on ARM, it's a macro and that causes a compiler warning when its return code is not used: drivers/firmware/efi/arm-runtime.c: In function 'efi_virtmap_init': arch/arm/include/asm/mmu_context.h:88:34: warning: statement with no effect [-Wunused-value] #define init_new_context(tsk,mm) 0 drivers/firmware/efi/arm-runtime.c:47:2: note: in expansion of macro 'init_new_context' init_new_context(NULL, &efi_mm); This changes the definition into an inline function, which gcc does not warn about. Signed-off-by: Arnd Bergmann Fixes: f7d924894265 ("arm64/efi: refactor EFI init and runtime code for reuse by 32-bit ARM") --- This has newly showed up in ARM randconfig builds diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index 432ce8176498..fa5b42d44985 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h @@ -26,7 +26,12 @@ void __check_vmalloc_seq(struct mm_struct *mm); #ifdef CONFIG_CPU_HAS_ASID void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); -#define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.id, 0); 0; }) +static inline int +init_new_context(struct task_struct *tsk, struct mm_struct *mm) +{ + atomic64_set(&mm->context.id, 0); + return 0; +} #ifdef CONFIG_ARM_ERRATA_798181 void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, @@ -85,7 +90,12 @@ static inline void finish_arch_post_lock_switch(void) #endif /* CONFIG_MMU */ -#define init_new_context(tsk,mm) 0 +static inline int +init_new_context(struct task_struct *tsk, struct mm_struct *mm) +{ + return 0; +} + #endif /* CONFIG_CPU_HAS_ASID */