2007-10-23 07:16:14

by Luming Yu

[permalink] [raw]
Subject: [PATCH] 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

Signed-off-by: Yu Luming <[email protected]>


Attachments:
(No filename) (330.00 B)
correct_per_cpu_offset.patch (487.00 B)
Download all attachments

2007-10-30 07:15:40

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] fix typo in per_cpu_offset

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 <[email protected]>

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 <[email protected]>

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

2007-10-30 07:36:58

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] fix typo in per_cpu_offset

From: Simon Horman <[email protected]>
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

2007-10-30 08:51:17

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] fix typo in per_cpu_offset

On Tue, Oct 30, 2007 at 12:36:22AM -0700, David Miller wrote:
> From: Simon Horman <[email protected]>
> 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/

2007-11-07 06:44:44

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] fix typo in per_cpu_offset

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 <[email protected]>
> > 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/

2007-11-07 06:50:44

by Luming Yu

[permalink] [raw]
Subject: Re: [PATCH] fix typo in per_cpu_offset

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 <[email protected]> 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 <[email protected]>
> > > 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/
>
>