Skip to contentSkip to conversation

fix typo in per_cpu_offset

PATCH In review Luming Yu 3 participants 6 messages Oct 23, 2007 – Nov 7, 2007

lore
Share & tools
lore

Luming Yu

author
#0 lore raw

PATCH 1/1 fix typo in per_cpu_offset

Hello list,

there is a typo in the definition of per_cpu_offset because, for ia64, the __per_cpu_offset is an array.

extern unsigned long __per_cpu_offset[NR_CPUS];
-#define per_cpu_offset(x) (__per_cpu_offset(x))
+#define per_cpu_offset(x) (__per_cpu_offset[x])

Thanks,
Luming

include/asm-ia64/percpu.h +1 -1
index 43a7aac..c4f1e32 100644
@@ -46,7 +46,7 @@ #endif
 #ifdef CONFIG_SMP
 
 extern unsigned long __per_cpu_offset[NR_CPUS];
-#define per_cpu_offset(x) (__per_cpu_offset(x))
+#define per_cpu_offset(x) (__per_cpu_offset[x])
 
 /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
 DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Luming Yu

Hello list,

there is a typo in the definition of per_cpu_offset because, for ia64, the __per_cpu_offset is an array.

extern unsigned long __per_cpu_offset[NR_CPUS];

include/asm-ia64/percpu.h +1 -1
-#define per_cpu_offset(x) (__per_cpu_offset(x))
+#define per_cpu_offset(x) (__per_cpu_offset[x])
Quoted 4 lines

Thanks,
Luming

This looks correct to me, and gcc seems to agree too.

Though curiuously with my config nothing uses per_cpu_offset() (I added a bogus call to produce an error.) Is it actually used on ia64?

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#2 lore raw

From: Simon Horman <[email protected]>
Date: Tue, 30 Oct 2007 16:15:13 +0900

Quoted 3 lines

Though curiuously with my config nothing uses per_cpu_offset() (I added a bogus call to produce an error.) Is it actually used on ia64?

It is unused, and in that regard should probably be deleted.

include/asm-generic/percpu.h defines a seemingly similarly unused per_cpu_offset() macro define as well

#3 lore raw
Quoted 11 lines · David Miller

From: Simon Horman <[email protected]>
Date: Tue, 30 Oct 2007 16:15:13 +0900

Quoted 3 lines

Though curiuously with my config nothing uses per_cpu_offset() (I added a bogus call to produce an error.) Is it actually used on ia64?

It is unused, and in that regard should probably be deleted.

include/asm-generic/percpu.h defines a seemingly similarly unused per_cpu_offset() macro define as well

It looks like they were both added by "[PATCH] lockdep: add per_cpu_offset()" (a875a69f8b00a38b4f40d9632a4fc71a159f0e0d)

Perhaps they were used at that time?

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#4 lore raw
Quoted 10 lines · Simon Horman
Quoted 9 lines · David Miller

From: Simon Horman <[email protected]>
Date: Tue, 30 Oct 2007 16:15:13 +0900

Quoted 3 lines

Though curiuously with my config nothing uses per_cpu_offset() (I added a bogus call to produce an error.) Is it actually used on ia64?

It is unused, and in that regard should probably be deleted.

Quoted 7 lines
Quoted 2 lines

include/asm-generic/percpu.h defines a seemingly similarly unused per_cpu_offset() macro define as well

It looks like they were both added by "[PATCH] lockdep: add per_cpu_offset()" (a875a69f8b00a38b4f40d9632a4fc71a159f0e0d)

Perhaps they were used at that time?

I looked into this a little further:

I'm pretty much convinced that the asm-ia64 version of per_cpu_offset() is unused as ia64 doesn't have lockdep. I will send a patch to get rid of it. The generic version might be used on mips, sh or arm with CONFIG_SMP, as these architectures have lockdep. I did managed to produce a compiler error on mips by removing the asm-generic version of per_cpu_offset().

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
author
#5 lore raw

NAK for now.

I'm trying to add lockdep , so please don't delete it until it could be proved really useless...
Please don't hurry...

Quoted 34 lines · Simon Horman
Quoted 10 lines · Simon Horman
Quoted 9 lines · David Miller

From: Simon Horman <[email protected]>
Date: Tue, 30 Oct 2007 16:15:13 +0900

Quoted 3 lines

Though curiuously with my config nothing uses per_cpu_offset() (I added a bogus call to produce an error.) Is it actually used on ia64?

It is unused, and in that regard should probably be deleted.

Quoted 7 lines
Quoted 2 lines

include/asm-generic/percpu.h defines a seemingly similarly unused per_cpu_offset() macro define as well

It looks like they were both added by "[PATCH] lockdep: add per_cpu_offset()" (a875a69f8b00a38b4f40d9632a4fc71a159f0e0d)

Perhaps they were used at that time?

I looked into this a little further:

I'm pretty much convinced that the asm-ia64 version of per_cpu_offset() is unused as ia64 doesn't have lockdep. I will send a patch to get rid of it. The generic version might be used on mips, sh or arm with CONFIG_SMP, as these architectures have lockdep. I did managed to produce a compiler error on mips by removing the asm-generic version of per_cpu_offset().

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/