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]
Message-Id: <20170621215741.4028236-1-arnd@arndb.de>
Date:   Wed, 21 Jun 2017 23:57:28 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     "Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Anna-Maria Gleixner <anna-maria@...utronix.de>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] rcu: remove unused variable in boot_cpu_state_init

Without CONFIG_SMP, we get a harmless warning about
an unused variable:

kernel/cpu.c: In function 'boot_cpu_state_init':
kernel/cpu.c:1778:6: error: unused variable 'cpu' [-Werror=unused-variable]

This reworks the function to have the declaration inside
of the #ifdef.

Fixes: faeb334286b7 ("rcu: Migrate callbacks earlier in the CPU-offline timeline")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index f13ad79e785d..9cd4fc35a66f 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1775,11 +1775,11 @@ void __init boot_cpu_init(void)
  */
 void __init boot_cpu_state_init(void)
 {
+#ifdef CONFIG_SMP
 	int cpu;
 
-	per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
-#ifdef CONFIG_SMP
 	for_each_possible_cpu(cpu)
 		per_cpu_ptr(&cpuhp_state, cpu)->cpu = cpu;
 #endif
+	per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
 }
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ