summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-09-17 06:44:13 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-17 06:44:13 -0700
commit708513359d13a9bb7991552fb28abb53728369af (patch)
tree120507ccaa86ea72dfc4fa0140cebd3affed114f /include
parentdb2787b45d006b6a0b41cfc787d8081b1eef3be6 (diff)
[PATCH] Re: per_cpu data question
I suck. Lvalues continue to haunt me. This works for me. BTW, I prefer to have bug reports cc'd to linux-kernel, so the results are archived. Plus, public humiliation is good for the soul.
Diffstat (limited to 'include')
-rw-r--r--include/linux/percpu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 06ff863fbc95..a79d04de4fd5 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -3,7 +3,8 @@
#include <linux/spinlock.h> /* For preempt_disable() */
#include <asm/percpu.h>
-#define get_cpu_var(var) ({ preempt_disable(); __get_cpu_var(var); })
+/* Must be an lvalue. */
+#define get_cpu_var(var) (*({ preempt_disable(); &__get_cpu_var(var); }))
#define put_cpu_var(var) preempt_enable()
#endif /* __LINUX_PERCPU_H */