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

From: Andrew Morton
Date: Mon Feb 08 2010 - 03:33:45 EST


On Sun, 7 Feb 2010 21:31:56 +0100 Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:

> Shouldn't put_cpu() take a (possibly dummy) `cpu' parameter, as
> returned by get_cpu()?

Yeah, that always seemed a bit screwy. Something like this...

--- a/include/linux/smp.h~a
+++ a/include/linux/smp.h
@@ -177,6 +177,15 @@ smp_call_function_any(const struct cpuma
#define put_cpu() preempt_enable()

/*
+ * This just exists to touch the `cpu' arg, to suppress unused var
+ * warnings
+ */
+static inline void put_cpu_nr(unsigned cpu)
+{
+ put_cpu();
+}
+
+/*
* Callback to arch code if there's nosmp or maxcpus=0 on the
* boot command line:
*/
_

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