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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 07 Feb 2010 20:58:58 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH] sched: Fix unused variable warning on UP (was: Re: 
 linux-next: tip tree build warning)

On Sun, 2010-02-07 at 20:57 +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 1, 2010 at 08:12, Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> > Today's linux-next build (powerpc allnoconfig) produced this warning:
> >
> > kernel/sched.c: In function 'wake_up_new_task':
> > kernel/sched.c:2631: warning: unused variable 'cpu'
> >
> > Introduced by commit fabf318e5e4bda0aca2b0d617b191884fda62703 ("sched:
> > Fix fork vs hotplug vs cpuset namespaces").
> 
> And now we have it in 2.6.33-rc7, too...
> Patch below (FWIW, compile-tested on m68k with CONFIG_SMP=n only).
> 
> ---
> From cbf4f334632ade9c5ed9b88728ec82af074e4ace Mon Sep 17 00:00:00 2001
> From: Geert Uytterhoeven <geert@...ux-m68k.org>
> Date: Sun, 7 Feb 2010 20:47:30 +0100
> Subject: [PATCH] sched: Fix unused variable warning on UP
> 
> Fix warning
> 
> | kernel/sched.c:2650: warning: unused variable 'cpu'
> 
> if CONFIG_SMP is not set.
> 
> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> ---
>  kernel/sched.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 3a8fb30..c47561e 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
> +	int cpu = get_cpu();
> +
>  	/*
>  	 * Fork balancing, do it here and not earlier because:
>  	 *  - cpus_allowed can change in the fork path

Which introduces a preempt imbalance... I like akpm's fix much better.

--
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