]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] Shut up per_cpu_ptr() on UP
authorPaul Mundt <lethal@linux-sh.org>
Mon, 14 Nov 2005 00:07:21 +0000 (16:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 14 Nov 2005 02:14:15 +0000 (18:14 -0800)
Currently per_cpu_ptr() doesn't really do anything with 'cpu' in the UP
case.  This is problematic in the cases where this is the only place the
variable is referenced:

  CC      kernel/workqueue.o
  kernel/workqueue.c: In function `current_is_keventd':
  kernel/workqueue.c:460: warning: unused variable `cpu'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/percpu.h

index 5451eb1e781d37f67d29ab2e140bef34182fec8e..fb8d2d24e4bb1d855b4d6017202c6dca2882dfa1 100644 (file)
@@ -38,7 +38,7 @@ extern void free_percpu(const void *);
 
 #else /* CONFIG_SMP */
 
-#define per_cpu_ptr(ptr, cpu) (ptr)
+#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
 
 static inline void *__alloc_percpu(size_t size, size_t align)
 {