public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: dipankar@in.ibm.com
Cc: trivial@rustcorp.com.au, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org
Subject: Re: per_cpu data question
Date: Fri, 30 Aug 2002 11:59:20 +1000	[thread overview]
Message-ID: <20020830005909.926812C224@lists.samba.org> (raw)
In-Reply-To: Your message of "Thu, 29 Aug 2002 18:24:31 +0530." <20020829182431.A4936@in.ibm.com>

In message <20020829182431.A4936@in.ibm.com> you write:
> Hi Rusty,
> 
> I can't do this -
> 
>         struct rcu_data *rdata;
>         rdata = &get_cpu_var(rcu_data);
> 
> Has this been deliberately made illegal ?

No, 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.

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-08-30  5:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20020829182431.A4936@in.ibm.com>]

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=20020830005909.926812C224@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=dipankar@in.ibm.com \
    --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