All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] sched: Fix unused variable warning on UP (was: Re: linux-next: tip tree build warning)
Date: Sun, 07 Feb 2010 20:58:58 +0100	[thread overview]
Message-ID: <1265572738.12224.278.camel@laptop> (raw)
In-Reply-To: <10f740e81002071157p11b78784i8091d4790c29f30d@mail.gmail.com>

On Sun, 2010-02-07 at 20:57 +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 1, 2010 at 08:12, Stephen Rothwell <sfr@canb.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@linux-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@linux-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.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] sched: Fix unused variable warning on UP (was: Re:  linux-next: tip tree build warning)
Date: Sun, 07 Feb 2010 20:58:58 +0100	[thread overview]
Message-ID: <1265572738.12224.278.camel@laptop> (raw)
In-Reply-To: <10f740e81002071157p11b78784i8091d4790c29f30d@mail.gmail.com>

On Sun, 2010-02-07 at 20:57 +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 1, 2010 at 08:12, Stephen Rothwell <sfr@canb.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@linux-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@linux-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.


  reply	other threads:[~2010-02-07 19:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-07 19:57 [PATCH] sched: Fix unused variable warning on UP (was: Re: linux-next: tip tree build warning) Geert Uytterhoeven
2010-02-07 19:57 ` Geert Uytterhoeven
2010-02-07 19:58 ` Peter Zijlstra [this message]
2010-02-07 19:58   ` Peter Zijlstra
2010-02-07 20:26   ` Geert Uytterhoeven
2010-02-07 20:26     ` Geert Uytterhoeven
2010-02-07 20:31     ` Geert Uytterhoeven
2010-02-07 20:31       ` Geert Uytterhoeven
2010-02-08  8:32       ` Andrew Morton
2010-02-08  8:32         ` Andrew Morton
2010-02-08  9:47       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265572738.12224.278.camel@laptop \
    --to=peterz@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.