From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932621AbdEKPPE (ORCPT ); Thu, 11 May 2017 11:15:04 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54897 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932391AbdEKPO6 (ORCPT ); Thu, 11 May 2017 11:14:58 -0400 From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Paolo Bonzini , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: [PATCH] smp_call_function: use inline helpers instead of macros Date: Thu, 11 May 2017 17:13:42 +0200 Message-Id: <20170511151418.2700143-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:8JuLHOBT1moi1zdPOYmAYfIOD/xuvEZEybaNo9WekQ8mF+5QENW NsFEtqoxnPBuxrbQ0KUkc8CdnzaCJz1kbtrX3oyoUrFt2dNobwngODHQHcJih7bUmJ8oV1o moV1NDW/z1NpYUQircln8DA4C7BvY6cEqGLojWG437A9QRdYUfBJvPCMOaRIsZrLov6zBM7 WtQtSZ6/IilkMvPpBJtdA== X-UI-Out-Filterresults: notjunk:1;V01:K0:VDHqQ35qYq8=:niOarAiy3x47vspOj1iLr4 mnh8P8WCyMrBUDttvDgJiNSQ7AtccfkAf+F+5CvU6eWSNeNmL0ltqO/pwfCHCU14b6odkzZqO b+PaeV5IdNHk/hSrhyGdL79wEcsvRSuDsOTD3vY7FMhl224IDR7lR1OUETJRxhFnyVykL7yD5 EFKRd1wBDAUey3wwf+AoMbmv3RHKlURbIKEjp6RUeqvruuW+gOCoNP2wuCe1y4uy1WVlpVLDL osMwa9N1p1uN71PlLWR29Hkjs7UvqBzSPnYQaOAIrT/VxBJZdpWetNQ9jlRF+RyzUwAVtICkv zZGM12dBwQd0YENQnhj0tMagIV0nNK5i3+EpjNjgjze7eezxSpdQ2ExigFwvo6b1UaaNVl7/g +sVYwRW5H+EJynWGI1gNg2orLCNH+rV7oG/j0Ujzz1UXQ1gE9tqRfb91dWdhanCVWTIH2t7EE wN7smazTyyXUXI53cDNyMHMLxfsccQ42T6EHvCl5MH/qFQlX/YfSGEr9A8BjA/9rUc5qdcp/D ToQrVF9kdk950Y6Ywl8xlEhMJaJReER8iOiYgcL2c8U4uccwbF28y5aGJFLG1ylvYGGehFK2T H4Ah/oi3IDwfz5UQYe8fSItNZoQzhGonoCain7rmXDsEw2ZeHMFG9WoT9LHi4tXsG/Y5qe+m2 SNNk/NnU1v5RLoJqoquPX/19EGaFeffD9dgslHnylHJ8rMV+5H/faIiLgLUuyRnMjSx4= Sender: linux-kernel-owner@vger.kernel.org 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. 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); +} 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 -- 2.9.0