From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756899AbdEKPfR (ORCPT ); Thu, 11 May 2017 11:35:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60519 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756877AbdEKPeZ (ORCPT ); Thu, 11 May 2017 11:34:25 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4FADC42BBB Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4FADC42BBB Subject: Re: [PATCH] smp_call_function: use inline helpers instead of macros To: Arnd Bergmann , Andrew Morton Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org References: <20170511151418.2700143-1-arnd@arndb.de> From: Paolo Bonzini Message-ID: <70b92304-becb-9f0a-2cf6-dc90a1173dd4@redhat.com> Date: Thu, 11 May 2017 17:34:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170511151418.2700143-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 11 May 2017 15:34:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/05/2017 17:13, Arnd Bergmann wrote: > 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. > > Fixes: 7a97cec26b94 ("KVM: mark requests that need synchronization") > Cc: Paolo Bonzini > Signed-off-by: Arnd Bergmann > --- > include/linux/smp.h | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/include/linux/smp.h b/include/linux/smp.h > index e978ec742103..acd401c0c77d 100644 > --- a/include/linux/smp.h > +++ b/include/linux/smp.h > @@ -144,13 +144,20 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info) > { > return 0; > } > -#define smp_call_function(func, info, wait) \ > - (up_smp_call_function(func, info)) > +static inline int smp_call_function(smp_call_func_t func, void *info, int wait) > +{ > + return up_smp_call_function(func, info); > +} You can just delete up_smp_call_function and return 0. The purpose of up_smp_call_function was only to eat warnings about those two arguments, as far as I could see. (I sent almost exactly the same patch to Paul this morning). Paolo > > 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) > +{ > + up_smp_call_function(func, info); > +} > + > static inline void call_function_init(void) { } > > static inline int >