Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560661 > unrolled thread

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

Started byTobias Klauser <tklauser@distanz.ch>
First post2017-01-17 15:40 +0100
Last post2017-01-18 12:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] cpu/hotplug: Remove unused but set variable in _cpu_down() Tobias Klauser <tklauser@distanz.ch> - 2017-01-17 15:40 +0100
    [tip:smp/urgent] cpu/hotplug: Remove unused but set variable in  _cpu_down() tip-bot for Tobias Klauser <tipbot@zytor.com> - 2017-01-18 12:50 +0100

#1560661 — [PATCH] cpu/hotplug: Remove unused but set variable in _cpu_down()

FromTobias Klauser <tklauser@distanz.ch>
Date2017-01-17 15:40 +0100
Subject[PATCH] cpu/hotplug: Remove unused but set variable in _cpu_down()
Message-ID<t0D5x-8eI-51@gated-at.bofh.it>
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.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 kernel/cpu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index f75c4d031eeb..f6b166ac7873 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -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;
-- 
2.11.0

[toc] | [next] | [standalone]


#1561673 — [tip:smp/urgent] cpu/hotplug: Remove unused but set variable in _cpu_down()

Fromtip-bot for Tobias Klauser <tipbot@zytor.com>
Date2017-01-18 12:50 +0100
Subject[tip:smp/urgent] cpu/hotplug: Remove unused but set variable in _cpu_down()
Message-ID<t0WUz-3AT-29@gated-at.bofh.it>
In reply to#1560661
Commit-ID:  0fec9557fd0c5349e3bd1a2141612a60bc20bb71
Gitweb:     http://git.kernel.org/tip/0fec9557fd0c5349e3bd1a2141612a60bc20bb71
Author:     Tobias Klauser <tklauser@distanz.ch>
AuthorDate: Tue, 17 Jan 2017 15:35:01 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
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")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20170117143501.20893-1-tklauser@distanz.ch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 kernel/cpu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index c475063..0a5f630 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -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;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web