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-prev] [day] [month] [year] [list]
Message-Id: <9001dbb8699166c6b3aab195be85ff772845bfe9.1265612317.git.baruch@tkos.co.il>
Date:	Mon,  8 Feb 2010 09:01:10 +0200
From:	Baruch Siach <baruch@...s.co.il>
To:	linux-kernel@...r.kernel.org
Cc:	Baruch Siach <baruch@...s.co.il>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH v2] sched: fix unused variable warning when !CONFIG_SMP

This variable was introduced by fabf318e. Now actually tested.

Signed-off-by: Baruch Siach <baruch@...s.co.il>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
---
 kernel/sched.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 3a8fb30..faf7021 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2647,9 +2647,10 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 {
 	unsigned long flags;
 	struct rq *rq;
-	int cpu = get_cpu();
 
 #ifdef CONFIG_SMP
+	get_cpu();
+
 	/*
 	 * Fork balancing, do it here and not earlier because:
 	 *  - cpus_allowed can change in the fork path
@@ -2659,8 +2660,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 	 * ->cpus_allowed is stable, we have preemption disabled, meaning
 	 * cpu_online_mask is stable.
 	 */
-	cpu = select_task_rq(p, SD_BALANCE_FORK, 0);
-	set_task_cpu(p, cpu);
+	set_task_cpu(p, select_task_rq(p, SD_BALANCE_FORK, 0));
 #endif
 
 	rq = task_rq_lock(p, &flags);
@@ -2675,7 +2675,9 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
 		p->sched_class->task_woken(rq, p);
 #endif
 	task_rq_unlock(rq, &flags);
+#ifdef CONFIG_SMP
 	put_cpu();
+#endif
 }
 
 #ifdef CONFIG_PREEMPT_NOTIFIERS
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ