From patchwork Wed Jul 26 13:32:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108757 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp810288qge; Wed, 26 Jul 2017 06:35:49 -0700 (PDT) X-Received: by 10.84.236.70 with SMTP id h6mr928975pln.345.1501076148930; Wed, 26 Jul 2017 06:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501076148; cv=none; d=google.com; s=arc-20160816; b=WvIODSyCxOX3ZBNgqoqYOpPPf2zXeffSY4VGvf/q57j1ymDzdAIfdUE7MJi4UJkQn2 XV5Fqbm+u7DvZJ/Qdb4trWe5dwOO+42M5TDxXD40ui7i7NTd2VXmHxkhyGXOoNi4V7HM Xb7/VcCT5m9ZrAHtUX0wf3+r9VT3huNAp1EhOh3lOPs1qwvgHd8EeoYd5zjHvlLHGjDr bJIFPG04myZtz15UuUfe+wyTkLicshm66FkQ2qh9IZIs6xWgp1yoCLJKIpmR+p18slGi 9F+VuOcSITiyex6hBngnXF6LFMCPGr3fDLG2HTN6h3TwPnzqsduHaUF91qBpwcypylqJ q+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=oMJWyR6yEe0MXBQr4IlmiAqooI0Y6trmPW6muZmzZJ8=; b=jqz2Y9KD/FjyiugWfCJZJ163bjPAjdmo40FnwAYqqvvi57ldpPcb90tEKvIh/xYFbo RohmAPBU7LXN0P8Osnk5R82NLgwZ9nuSAZoHslx3G7d9XuXF3IjZqzmFSM0qQaJA9TlF 6DJaMr7+arVAX3Ds/T4e94pgM7kqiYKCUnOF+NKy0cuCOPYj9Obz2//G3yLMQh32QoAd uujMB7vkH/MndEzWUgOkHU3hIneJYxDbphXPfV3Fd2kDuqPdax1IoOU41BOU1d5MCeSc lZzt4YcQp/LegcvdGojHpYCq1Uo6jKMPSSpuTVZI5P3ieA+x6wm4tCW24x+a+cyDdANF Rcpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si9927402pgk.19.2017.07.26.06.35.48; Wed, 26 Jul 2017 06:35:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751766AbdGZNfq (ORCPT + 26 others); Wed, 26 Jul 2017 09:35:46 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:62705 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbdGZNfo (ORCPT ); Wed, 26 Jul 2017 09:35:44 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M2Mj6-1dszmH2zem-00s6cO; Wed, 26 Jul 2017 15:34:57 +0200 From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Paolo Bonzini , Ralf Baechle , James Hogan , Paul Burton , Peter Zijlstra , Juergen Gross , Ingo Molnar , Thomas Gleixner , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] smp_call_function: use inline helpers instead of macros Date: Wed, 26 Jul 2017 15:32:28 +0200 Message-Id: <20170726133447.2056379-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0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ner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new caller of smp_call_function() passes a local variable as the 'wait' argument, and that variable is otherwise unused, so we get a warning in non-SMP configurations: virt/kvm/kvm_main.c: In function 'kvm_make_all_cpus_request': virt/kvm/kvm_main.c:195:7: error: unused variable 'wait' [-Werror=unused-variable] bool wait = req & KVM_REQUEST_WAIT; This addresses the warning by changing the two macros into inline functions. As reported by the 0day build bot, a small change is required in the MIPS r4k code for this, which then gets a warning about a missing variable. Fixes: 7a97cec26b94 ("KVM: mark requests that need synchronization") Cc: Paolo Bonzini Link: https://patchwork.kernel.org/patch/9722063/ Signed-off-by: Arnd Bergmann --- v2: - fix MIPS build error reported by kbuild test robot - remove up_smp_call_function() --- arch/mips/mm/c-r4k.c | 2 ++ include/linux/smp.h | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) -- 2.9.0 diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 81d6a15c93d0..f353bf5f24f1 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -97,9 +97,11 @@ static inline void r4k_on_each_cpu(unsigned int type, void (*func)(void *info), void *info) { preempt_disable(); +#ifdef CONFIG_SMP if (r4k_op_needs_ipi(type)) smp_call_function_many(&cpu_foreign_map[smp_processor_id()], func, info, 1); +#endif func(info); preempt_enable(); } diff --git a/include/linux/smp.h b/include/linux/smp.h index 68123c1fe549..ea24e2d3504c 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -135,17 +135,19 @@ static inline void smp_send_stop(void) { } * These macros fold the SMP functionality into a single CPU system */ #define raw_smp_processor_id() 0 -static inline int up_smp_call_function(smp_call_func_t func, void *info) +static inline int smp_call_function(smp_call_func_t func, void *info, int wait) { return 0; } -#define smp_call_function(func, info, wait) \ - (up_smp_call_function(func, info)) static inline void smp_send_reschedule(int cpu) { } #define smp_prepare_boot_cpu() do {} while (0) -#define smp_call_function_many(mask, func, info, wait) \ - (up_smp_call_function(func, info)) + +static inline void smp_call_function_many(const struct cpumask *mask, + smp_call_func_t func, void *info, bool wait) +{ +} + static inline void call_function_init(void) { } static inline int