linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
       [not found]               ` <20080705020350.GN14894@parisc-linux.org>
@ 2008-07-22 10:05                 ` Andrew Morton
  2008-07-22 10:05                   ` Andrew Morton
                                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrew Morton @ 2008-07-22 10:05 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Linus Torvalds, Peter Anvin, David S. Miller, linux-ia64,
	linuxppc-dev, linux-kernel, linux-arch

On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <matthew@wil.cx> wrote:

> [PATCH] Make u64 long long on all architectures
> 
> It is currently awkward to print a u64 type.  Some architectures use
> unsigned long while others use unsigned long long.  Since unsigned long
> long is 64-bit for all existing Linux architectures, change those that
> use long to use long long.  Note that this applies only within the
> kernel.  If u64 is being used in a C++ method definition, the symbol
> mangling would change.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> 
> diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
> index 2af9b75..32f07bd 100644
> --- a/include/asm-generic/int-l64.h
> +++ b/include/asm-generic/int-l64.h
> @@ -23,8 +23,13 @@ typedef unsigned short __u16;
>  typedef __signed__ int __s32;
>  typedef unsigned int __u32;
>  
> +#ifdef __KERNEL__
> +typedef __signed__ long long __s64;
> +typedef unsigned long long __u64;
> +#else
>  typedef __signed__ long __s64;
>  typedef unsigned long __u64;
> +#endif
>  
>  #endif /* __ASSEMBLY__ */

This is (IMO) a desirable change and will prevent a heck of a lot of
goofing around, and will permit a lot of prior goofing around to
be removed.

But I bet there are lots of instalces of printk("%l", some_u64) down in
arch code where the type of u64 _is_ known which will now spew warnings.

Oh well.

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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:05                 ` [PATCH] Make u64 long long on all architectures (was: the printk problem) Andrew Morton
@ 2008-07-22 10:05                   ` Andrew Morton
  2008-07-22 10:36                   ` Michael Ellerman
  2008-07-22 11:35                   ` Benjamin Herrenschmidt
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2008-07-22 10:05 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Linus Torvalds, Peter Anvin, David S. Miller, linux-ia64,
	linuxppc-dev, linux-kernel, linux-arch

On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <matthew@wil.cx> wrote:

> [PATCH] Make u64 long long on all architectures
> 
> It is currently awkward to print a u64 type.  Some architectures use
> unsigned long while others use unsigned long long.  Since unsigned long
> long is 64-bit for all existing Linux architectures, change those that
> use long to use long long.  Note that this applies only within the
> kernel.  If u64 is being used in a C++ method definition, the symbol
> mangling would change.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> 
> diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
> index 2af9b75..32f07bd 100644
> --- a/include/asm-generic/int-l64.h
> +++ b/include/asm-generic/int-l64.h
> @@ -23,8 +23,13 @@ typedef unsigned short __u16;
>  typedef __signed__ int __s32;
>  typedef unsigned int __u32;
>  
> +#ifdef __KERNEL__
> +typedef __signed__ long long __s64;
> +typedef unsigned long long __u64;
> +#else
>  typedef __signed__ long __s64;
>  typedef unsigned long __u64;
> +#endif
>  
>  #endif /* __ASSEMBLY__ */

This is (IMO) a desirable change and will prevent a heck of a lot of
goofing around, and will permit a lot of prior goofing around to
be removed.

But I bet there are lots of instalces of printk("%l", some_u64) down in
arch code where the type of u64 _is_ known which will now spew warnings.

Oh well.

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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:05                 ` [PATCH] Make u64 long long on all architectures (was: the printk problem) Andrew Morton
  2008-07-22 10:05                   ` Andrew Morton
@ 2008-07-22 10:36                   ` Michael Ellerman
  2008-07-22 10:36                     ` Michael Ellerman
                                       ` (2 more replies)
  2008-07-22 11:35                   ` Benjamin Herrenschmidt
  2 siblings, 3 replies; 9+ messages in thread
From: Michael Ellerman @ 2008-07-22 10:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox, linux-arch, linux-ia64, linux-kernel,
	linuxppc-dev, Peter Anvin, Linus Torvalds, David S. Miller

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

On Tue, 2008-07-22 at 03:05 -0700, Andrew Morton wrote:
> On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <matthew@wil.cx> wrote:
> 
> > [PATCH] Make u64 long long on all architectures
> > 
> > It is currently awkward to print a u64 type.  Some architectures use
> > unsigned long while others use unsigned long long.  Since unsigned long
> > long is 64-bit for all existing Linux architectures, change those that
> > use long to use long long.  Note that this applies only within the
> > kernel.  If u64 is being used in a C++ method definition, the symbol
> > mangling would change.
> > 
> > Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> > 
> > diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
> > index 2af9b75..32f07bd 100644
> > --- a/include/asm-generic/int-l64.h
> > +++ b/include/asm-generic/int-l64.h
> > @@ -23,8 +23,13 @@ typedef unsigned short __u16;
> >  typedef __signed__ int __s32;
> >  typedef unsigned int __u32;
> >  
> > +#ifdef __KERNEL__
> > +typedef __signed__ long long __s64;
> > +typedef unsigned long long __u64;
> > +#else
> >  typedef __signed__ long __s64;
> >  typedef unsigned long __u64;
> > +#endif
> >  
> >  #endif /* __ASSEMBLY__ */
> 
> This is (IMO) a desirable change and will prevent a heck of a lot of
> goofing around, and will permit a lot of prior goofing around to
> be removed.
> 
> But I bet there are lots of instalces of printk("%l", some_u64) down in
> arch code where the type of u64 _is_ known which will now spew warnings.
> 
> Oh well.

As a rough estimate:

concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs grep "%l" | grep -v "%ll" | wc -l
635


Someone's gonna get a lot of git points for fixing all those. Might keep
the speeling fix crowd busy for a while.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:36                   ` Michael Ellerman
@ 2008-07-22 10:36                     ` Michael Ellerman
  2008-07-22 10:53                     ` Andrew Morton
  2008-07-22 11:36                     ` Benjamin Herrenschmidt
  2 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2008-07-22 10:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox, linux-arch, linux-ia64, linux-kernel,
	linuxppc-dev, Peter Anvin, Linus Torvalds, David S. Miller

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

On Tue, 2008-07-22 at 03:05 -0700, Andrew Morton wrote:
> On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <matthew@wil.cx> wrote:
> 
> > [PATCH] Make u64 long long on all architectures
> > 
> > It is currently awkward to print a u64 type.  Some architectures use
> > unsigned long while others use unsigned long long.  Since unsigned long
> > long is 64-bit for all existing Linux architectures, change those that
> > use long to use long long.  Note that this applies only within the
> > kernel.  If u64 is being used in a C++ method definition, the symbol
> > mangling would change.
> > 
> > Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> > 
> > diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
> > index 2af9b75..32f07bd 100644
> > --- a/include/asm-generic/int-l64.h
> > +++ b/include/asm-generic/int-l64.h
> > @@ -23,8 +23,13 @@ typedef unsigned short __u16;
> >  typedef __signed__ int __s32;
> >  typedef unsigned int __u32;
> >  
> > +#ifdef __KERNEL__
> > +typedef __signed__ long long __s64;
> > +typedef unsigned long long __u64;
> > +#else
> >  typedef __signed__ long __s64;
> >  typedef unsigned long __u64;
> > +#endif
> >  
> >  #endif /* __ASSEMBLY__ */
> 
> This is (IMO) a desirable change and will prevent a heck of a lot of
> goofing around, and will permit a lot of prior goofing around to
> be removed.
> 
> But I bet there are lots of instalces of printk("%l", some_u64) down in
> arch code where the type of u64 _is_ known which will now spew warnings.
> 
> Oh well.

As a rough estimate:

concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs grep "%l" | grep -v "%ll" | wc -l
635


Someone's gonna get a lot of git points for fixing all those. Might keep
the speeling fix crowd busy for a while.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:36                   ` Michael Ellerman
  2008-07-22 10:36                     ` Michael Ellerman
@ 2008-07-22 10:53                     ` Andrew Morton
  2008-07-22 11:36                     ` Benjamin Herrenschmidt
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2008-07-22 10:53 UTC (permalink / raw)
  To: michael
  Cc: Matthew Wilcox, linux-arch, linux-ia64, linux-kernel,
	linuxppc-dev, Peter Anvin, Linus Torvalds, David S. Miller

On Tue, 22 Jul 2008 20:36:35 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:

> On Tue, 2008-07-22 at 03:05 -0700, Andrew Morton wrote:
> > On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <matthew@wil.cx> wrote:
> > 
> > > [PATCH] Make u64 long long on all architectures
> > > 
> > > It is currently awkward to print a u64 type.  Some architectures use
> > > unsigned long while others use unsigned long long.  Since unsigned long
> > > long is 64-bit for all existing Linux architectures, change those that
> > > use long to use long long.  Note that this applies only within the
> > > kernel.  If u64 is being used in a C++ method definition, the symbol
> > > mangling would change.
> > > 
> > > Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
> > > 
> > > diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
> > > index 2af9b75..32f07bd 100644
> > > --- a/include/asm-generic/int-l64.h
> > > +++ b/include/asm-generic/int-l64.h
> > > @@ -23,8 +23,13 @@ typedef unsigned short __u16;
> > >  typedef __signed__ int __s32;
> > >  typedef unsigned int __u32;
> > >  
> > > +#ifdef __KERNEL__
> > > +typedef __signed__ long long __s64;
> > > +typedef unsigned long long __u64;
> > > +#else
> > >  typedef __signed__ long __s64;
> > >  typedef unsigned long __u64;
> > > +#endif
> > >  
> > >  #endif /* __ASSEMBLY__ */
> > 
> > This is (IMO) a desirable change and will prevent a heck of a lot of
> > goofing around, and will permit a lot of prior goofing around to
> > be removed.
> > 
> > But I bet there are lots of instalces of printk("%l", some_u64) down in
> > arch code where the type of u64 _is_ known which will now spew warnings.
> > 
> > Oh well.
> 
> As a rough estimate:
> 
> concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs grep "%l" | grep -v "%ll" | wc -l
> 635

lolz.  If yesterdays-linux-next on todays-mainline wasn't such a
hilarious trainwreck I'd test your grepping.  I guess that could be
done on mainline too.

> Someone's gonna get a lot of git points for fixing all those. Might keep
> the speeling fix crowd busy for a while.

I'm not sure I have the energy for this.

But we really should do it.

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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:05                 ` [PATCH] Make u64 long long on all architectures (was: the printk problem) Andrew Morton
  2008-07-22 10:05                   ` Andrew Morton
  2008-07-22 10:36                   ` Michael Ellerman
@ 2008-07-22 11:35                   ` Benjamin Herrenschmidt
  2008-07-22 11:35                     ` Benjamin Herrenschmidt
  2 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-22 11:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox, linux-arch, linux-ia64, linux-kernel,
	linuxppc-dev, Peter Anvin, Linus Torvalds, David S. Miller


> 
> This is (IMO) a desirable change and will prevent a heck of a lot of
> goofing around, and will permit a lot of prior goofing around to
> be removed.
> 
> But I bet there are lots of instalces of printk("%l", some_u64) down in
> arch code where the type of u64 _is_ known which will now spew warnings.

Well, I'm about to call a big "warning fixing day" on the powerpc list,
I saw a few today when building a couple of configs and that hurts my
eyes so we may as well fold that in :-)

Cheers,
Ben.
 


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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 11:35                   ` Benjamin Herrenschmidt
@ 2008-07-22 11:35                     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-22 11:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox, linux-arch, linux-ia64, linux-kernel,
	linuxppc-dev, Peter Anvin, Linus Torvalds, David S. Miller


> 
> This is (IMO) a desirable change and will prevent a heck of a lot of
> goofing around, and will permit a lot of prior goofing around to
> be removed.
> 
> But I bet there are lots of instalces of printk("%l", some_u64) down in
> arch code where the type of u64 _is_ known which will now spew warnings.

Well, I'm about to call a big "warning fixing day" on the powerpc list,
I saw a few today when building a couple of configs and that hurts my
eyes so we may as well fold that in :-)

Cheers,
Ben.
 


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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 10:36                   ` Michael Ellerman
  2008-07-22 10:36                     ` Michael Ellerman
  2008-07-22 10:53                     ` Andrew Morton
@ 2008-07-22 11:36                     ` Benjamin Herrenschmidt
  2008-07-22 11:36                       ` Benjamin Herrenschmidt
  2 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-22 11:36 UTC (permalink / raw)
  To: michael
  Cc: Andrew Morton, linux-arch, linux-ia64, Matthew Wilcox,
	linux-kernel, linuxppc-dev, Peter Anvin, Linus Torvalds,
	David S. Miller

On Tue, 2008-07-22 at 20:36 +1000, Michael Ellerman wrote:
> concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs
> grep "%l" | grep -v "%ll" | wc -l
> 635
> 
> 
> Someone's gonna get a lot of git points for fixing all those. Might
> keep
> the speeling fix crowd busy for a 

But a bunch of those might actually be real longs, not u64's ...

Easier to do the change and build something like ppc6xx_defconfig to get
a better approximation.

Ben.



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

* Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)
  2008-07-22 11:36                     ` Benjamin Herrenschmidt
@ 2008-07-22 11:36                       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-22 11:36 UTC (permalink / raw)
  To: michael
  Cc: Andrew Morton, linux-arch, linux-ia64, Matthew Wilcox,
	linux-kernel, linuxppc-dev, Peter Anvin, Linus Torvalds,
	David S. Miller

On Tue, 2008-07-22 at 20:36 +1000, Michael Ellerman wrote:
> concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs
> grep "%l" | grep -v "%ll" | wc -l
> 635
> 
> 
> Someone's gonna get a lot of git points for fixing all those. Might
> keep
> the speeling fix crowd busy for a 

But a bunch of those might actually be real longs, not u64's ...

Easier to do the change and build something like ppc6xx_defconfig to get
a better approximation.

Ben.



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

end of thread, other threads:[~2008-07-22 11:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080625131101.GA6205@digi.com>
     [not found] ` <20080704104634.GA31634@digi.com>
     [not found]   ` <20080704111540.ddffd241.akpm@linux-foundation.org>
     [not found]     ` <alpine.LFD.1.10.0807041147450.2815@woody.linux-foundation.org>
     [not found]       ` <alpine.LFD.1.10.0807041250220.2815@woody.linux-foundation.org>
     [not found]         ` <20080704132716.f1e12554.akpm@linux-foundation.org>
     [not found]           ` <20080704204252.GM14894@parisc-linux.org>
     [not found]             ` <20080704150100.1f7b8a65.akpm@linux-foundation.org>
     [not found]               ` <20080705020350.GN14894@parisc-linux.org>
2008-07-22 10:05                 ` [PATCH] Make u64 long long on all architectures (was: the printk problem) Andrew Morton
2008-07-22 10:05                   ` Andrew Morton
2008-07-22 10:36                   ` Michael Ellerman
2008-07-22 10:36                     ` Michael Ellerman
2008-07-22 10:53                     ` Andrew Morton
2008-07-22 11:36                     ` Benjamin Herrenschmidt
2008-07-22 11:36                       ` Benjamin Herrenschmidt
2008-07-22 11:35                   ` Benjamin Herrenschmidt
2008-07-22 11:35                     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).