mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] adjust per_cpu definition in non-SMP case
Date: Thu, 12 May 2005 10:46:49 +0200	[thread overview]
Message-ID: <s28325fb.011@emea1-mh.id2.novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Fix (in the architectures I'm actually building for) the UP definition of
per_cpu so that the cpu specified may be any expression, not just an
identifier or a suffix expression.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru linux-2.6.12-rc4.base/include/asm-generic/percpu.h linux-2.6.12-rc4/include/asm-generic/percpu.h
--- linux-2.6.12-rc4.base/include/asm-generic/percpu.h	2005-03-02 08:37:50.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-generic/percpu.h	2005-03-15 14:40:12.000000000 +0100
@@ -29,7 +29,7 @@ do {								\
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */
diff -Npru linux-2.6.12-rc4.base/include/asm-ia64/percpu.h linux-2.6.12-rc4/include/asm-ia64/percpu.h
--- linux-2.6.12-rc4.base/include/asm-ia64/percpu.h	2005-03-02 08:38:17.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-ia64/percpu.h	2005-03-15 14:40:12.000000000 +0100
@@ -50,7 +50,7 @@ extern void *per_cpu_init(void);
 
 #else /* ! SMP */
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 #define per_cpu_init()				(__phys_per_cpu_start)
 
diff -Npru linux-2.6.12-rc4.base/include/asm-x86_64/percpu.h linux-2.6.12-rc4/include/asm-x86_64/percpu.h
--- linux-2.6.12-rc4.base/include/asm-x86_64/percpu.h	2005-03-02 08:38:13.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-x86_64/percpu.h	2005-03-15 15:19:44.000000000 +0100
@@ -39,7 +39,7 @@ extern void setup_per_cpu_areas(void);
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */



[-- Attachment #2: linux-2.6.12-rc4-percpu.patch --]
[-- Type: text/plain, Size: 2074 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Fix (in the architectures I'm actually building for) the UP definition of
per_cpu so that the cpu specified may be any expression, not just an
identifier or a suffix expression.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru linux-2.6.12-rc4.base/include/asm-generic/percpu.h linux-2.6.12-rc4/include/asm-generic/percpu.h
--- linux-2.6.12-rc4.base/include/asm-generic/percpu.h	2005-03-02 08:37:50.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-generic/percpu.h	2005-03-15 14:40:12.000000000 +0100
@@ -29,7 +29,7 @@ do {								\
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */
diff -Npru linux-2.6.12-rc4.base/include/asm-ia64/percpu.h linux-2.6.12-rc4/include/asm-ia64/percpu.h
--- linux-2.6.12-rc4.base/include/asm-ia64/percpu.h	2005-03-02 08:38:17.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-ia64/percpu.h	2005-03-15 14:40:12.000000000 +0100
@@ -50,7 +50,7 @@ extern void *per_cpu_init(void);
 
 #else /* ! SMP */
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 #define per_cpu_init()				(__phys_per_cpu_start)
 
diff -Npru linux-2.6.12-rc4.base/include/asm-x86_64/percpu.h linux-2.6.12-rc4/include/asm-x86_64/percpu.h
--- linux-2.6.12-rc4.base/include/asm-x86_64/percpu.h	2005-03-02 08:38:13.000000000 +0100
+++ linux-2.6.12-rc4/include/asm-x86_64/percpu.h	2005-03-15 15:19:44.000000000 +0100
@@ -39,7 +39,7 @@ extern void setup_per_cpu_areas(void);
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
+#define per_cpu(var, cpu)			(*((void)(cpu), &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */

                 reply	other threads:[~2005-05-12  8:50 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=s28325fb.011@emea1-mh.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®