Skip to contentSkip to conversation

cpu/hotplug: Remove unused but set variable in _cpu_down()

PATCH New Tobias Klauser 2 participants 2 messages Jan 17, 2017 – Jan 18, 2017 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu/hotplug: Remove unused but set variable in _cpu_down()

After commit 530e9b76ae8f ("cpu/hotplug: Remove obsolete cpu hotplug register/unregister functions"), the variable hasdied in _cpu_down() is set but no longer read, leading to the following GCC warning when building with 'make W=1':

kernel/cpu.c:767:7: warning: variable ‘hasdied’ set but not used [-Wunused-but-set-variable]

Fix it by removing the variable.

---
 kernel/cpu.c | 2 --
 1 file changed, 2 deletions(-)
kernel/cpu.c +0 -2
index f75c4d031eeb..f6b166ac7873 100644
@@ -764,7 +764,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
 {
 	struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
 	int prev_state, ret = 0;
-	bool hasdied = false;
 
 	if (num_online_cpus() == 1)
 		return -EBUSY;
@@ -809,7 +808,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
 		cpuhp_kick_ap_work(cpu);
 	}
 
-	hasdied = prev_state != st->state && st->state == CPUHP_OFFLINE;
 out:
 	cpu_hotplug_done();
 	return ret;
Signature · 1 line
2.11.0
#1 lore raw
cpu/hotplug: Remove unused but set variable in _cpu_down()
Commit-ID:  0fec9557fd0c5349e3bd1a2141612a60bc20bb71
Gitweb:     http://git.kernel.org/tip/0fec9557fd0c5349e3bd1a2141612a60bc20bb71
Author:     Tobias Klauser <[email protected]>
AuthorDate: Tue, 17 Jan 2017 15:35:01 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 18 Jan 2017 11:55:09 +0100

cpu/hotplug: Remove unused but set variable in _cpu_down()

After the recent removal of the hotplug notifiers the variable 'hasdied' in _cpu_down() is set but no longer read, leading to the following GCC warning when building with 'make W=1':

kernel/cpu.c:767:7: warning: variable ‘hasdied’ set but not used [-Wunused-but-set-variable]

Fix it by removing the variable.

Fixes 530e9b76ae8f ("cpu/hotplug: Remove obsolete cpu hotplug register/unregister functions")
Cc Peter Zijlstra <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
---
 kernel/cpu.c | 2 --
 1 file changed, 2 deletions(-)
kernel/cpu.c +0 -2
index c475063..0a5f630 100644
@@ -764,7 +764,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
 {
 	struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
 	int prev_state, ret = 0;
-	bool hasdied = false;
 
 	if (num_online_cpus() == 1)
 		return -EBUSY;
@@ -809,7 +808,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
 		cpuhp_kick_ap_work(cpu);
 	}
 
-	hasdied = prev_state != st->state && st->state == CPUHP_OFFLINE;
 out:
 	cpu_hotplug_done();
 	return ret;