lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 May 2017 09:44:06 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Paul Mackerras <paulus@...abs.org>, kvm@...r.kernel.org
Cc:     kvm-ppc@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: Eliminate unused variable warning on uniprocessor
 configs



On 11/05/2017 05:40, Paul Mackerras wrote:
> When the
> kernel is compiled with CONFIG_SMP=n, smp_call_function_many() turns
> into a macro which doesn't use the 'wait' argument, leading to a
> warning about the variable 'wait' being unused:
> 
> /home/paulus/kernel/kvm/arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function ‘kvm_make_all_cpus_request’:
> /home/paulus/kernel/kvm/arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:195:7: error: unused variable ‘wait’ [-Werror=unused-variable]
>   bool wait = req & KVM_REQUEST_WAIT;

Maybe the macro should not be a macro:

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 8e0cb7a0f836..899c72f0933f 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -128,17 +128,18 @@ 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 void smp_call_function_many(const struct cpumask *mask,
+					  smp_call_func_t func, void *info,
+					  bool wait);
 {
-	return 0;
+}
+
+static inline void smp_call_function(smp_call_func_t func, void *info, bool wait);
+{
 }
-#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 call_function_init(void) { }
 
 static inline int


Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ