public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix typo in per_cpu_offset
@ 2007-10-23  7:15 Luming Yu
  2007-10-30  7:15 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Luming Yu @ 2007-10-23  7:15 UTC (permalink / raw)
  To: linux-ia64; +Cc: Linux Kernel

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

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

Signed-off-by: Yu Luming <luming.yu@intel.com>

[-- Attachment #2: correct_per_cpu_offset.patch --]
[-- Type: application/octet-stream, Size: 487 bytes --]

diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index 43a7aac..c4f1e32 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix typo in per_cpu_offset
  2007-10-23  7:15 [PATCH] fix typo in per_cpu_offset Luming Yu
@ 2007-10-30  7:15 ` Simon Horman
  2007-10-30  7:36   ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2007-10-30  7:15 UTC (permalink / raw)
  To: Luming Yu; +Cc: linux-ia64, Linux Kernel

On Tue, Oct 23, 2007 at 03:15:55PM +0800, Luming Yu wrote:
> 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
> 
> Signed-off-by: Yu Luming <luming.yu@intel.com>

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?

Acked-by: Simon Horman <horms@verge.net.au>

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix typo in per_cpu_offset
  2007-10-30  7:15 ` Simon Horman
@ 2007-10-30  7:36   ` David Miller
  2007-10-30  8:50     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2007-10-30  7:36 UTC (permalink / raw)
  To: horms; +Cc: luming.yu, linux-ia64, linux-kernel

From: Simon Horman <horms@verge.net.au>
Date: Tue, 30 Oct 2007 16:15:13 +0900

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix typo in per_cpu_offset
  2007-10-30  7:36   ` David Miller
@ 2007-10-30  8:50     ` Simon Horman
  2007-11-07  6:44       ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2007-10-30  8:50 UTC (permalink / raw)
  To: David Miller
  Cc: luming.yu, linux-ia64, linux-kernel, Ingo Molnar,
	Arjan van de Ven, Rusty Russell, Andrew Morton

On Tue, Oct 30, 2007 at 12:36:22AM -0700, David Miller wrote:
> From: Simon Horman <horms@verge.net.au>
> Date: Tue, 30 Oct 2007 16:15:13 +0900
> 
> > 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?

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix typo in per_cpu_offset
  2007-10-30  8:50     ` Simon Horman
@ 2007-11-07  6:44       ` Simon Horman
  2007-11-07  6:50         ` Luming Yu
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2007-11-07  6:44 UTC (permalink / raw)
  To: David Miller
  Cc: luming.yu, linux-ia64, linux-kernel, Ingo Molnar,
	Arjan van de Ven, Rusty Russell, Andrew Morton

On Tue, Oct 30, 2007 at 05:50:56PM +0900, Simon Horman wrote:
> On Tue, Oct 30, 2007 at 12:36:22AM -0700, David Miller wrote:
> > From: Simon Horman <horms@verge.net.au>
> > Date: Tue, 30 Oct 2007 16:15:13 +0900
> > 
> > > 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?

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/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix typo in per_cpu_offset
  2007-11-07  6:44       ` Simon Horman
@ 2007-11-07  6:50         ` Luming Yu
  0 siblings, 0 replies; 6+ messages in thread
From: Luming Yu @ 2007-11-07  6:50 UTC (permalink / raw)
  To: Simon Horman
  Cc: David Miller, linux-ia64, linux-kernel, Ingo Molnar,
	Arjan van de Ven, Rusty Russell, Andrew Morton

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

On 11/7/07, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Oct 30, 2007 at 05:50:56PM +0900, Simon Horman wrote:
> > On Tue, Oct 30, 2007 at 12:36:22AM -0700, David Miller wrote:
> > > From: Simon Horman <horms@verge.net.au>
> > > Date: Tue, 30 Oct 2007 16:15:13 +0900
> > >
> > > > 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?
>
> 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/
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-07  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23  7:15 [PATCH] fix typo in per_cpu_offset Luming Yu
2007-10-30  7:15 ` Simon Horman
2007-10-30  7:36   ` David Miller
2007-10-30  8:50     ` Simon Horman
2007-11-07  6:44       ` Simon Horman
2007-11-07  6:50         ` Luming Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox