Subject: Re: [PATCH] sched: Fix unused variable warning on UP (was: Re: linux-next: tip tree build warning)

From: "H. Peter Anvin" <[email-masked]>
Date: Mon, 08 Feb 2010 01:47:21 -0800

On 02/07/2010 12:31 PM, Geert Uytterhoeven wrote:
>
> <trying to completely destroy my credibility>
> Shouldn't put_cpu() take a (possibly dummy) `cpu' parameter, as
> returned by get_cpu()?
> </trying>
>

Please tell me that you're joking.

There is absolutely no reason for it, since there is only one CPU that 
you can put (the one you're already on.)  The only thing that will 
happen if you insist on carrying the CPU number forward (unless it is 
used anyway) is that the compiler will generate worse code.

get_cpu() returning the CPU you're on is a convenience; it's so you 
don't need to do a third operation just to get your current CPU number, 
but it could just as easily be done that way.

	-hpa