From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com
Cc: trivial@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: [PATCH] get_cpu_var must be an lvalue
Date: Thu, 12 Sep 2002 17:15:24 +1000 [thread overview]
Message-ID: <20020912072006.F23DA2C0CC@lists.samba.org> (raw)
Linus, please apply.
Name: get_per_cpu lvalue fix
Author: Rusty Russell
Status: Trivial
D: get_cpu_var(var) should be an lvalue. Spotted by Dipankar Sarma.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.32/include/linux/percpu.h working-2.5.32-percpu/include/linux/percpu.h
--- linux-2.5.32/include/linux/percpu.h 2002-08-28 09:29:53.000000000 +1000
+++ working-2.5.32-percpu/include/linux/percpu.h 2002-08-30 11:50:46.000000000 +1000
@@ -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 */
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
reply other threads:[~2002-09-12 7:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020912072006.F23DA2C0CC@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=trivial@rustcorp.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).