[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081222151338.3b6ef997.akpm@linux-foundation.org>
Date: Mon, 22 Dec 2008 15:13:38 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Sam Ravnborg <sam@...nborg.org>
Cc: mingo@...e.hu, sfr@...b.auug.org.au, linux-kernel@...r.kernel.org,
kenchen@...gle.com, paulus@...ba.org, tglx@...utronix.de,
hpa@...or.com, linux-next@...r.kernel.org, davem@...emloft.net
Subject: Re: [patch] powerpc: change u64/s64 to a long long integer type
On Tue, 23 Dec 2008 00:00:35 +0100
Sam Ravnborg <sam@...nborg.org> wrote:
> On Mon, Dec 22, 2008 at 02:43:19PM -0800, Andrew Morton wrote:
> > On Mon, 22 Dec 2008 09:03:41 +0100
> > Ingo Molnar <mingo@...e.hu> wrote:
> >
> > > Subject: powerpc: change u64/s64 to a long long integer type
> >
> > <applause>
> >
> > There are lots of other architctures that need doing though.
>
> I have missed the introduction.
> Can you explain why?
People keep on doing
printk("%llu", some_u64);
testing it only on x86_64 and this generates a warning storm on
powerpc, sparc64, etc. Because they use `long', not `long long'.
And not just a little bit - this bug gets repeated maybe ten times per
week - it's insane.
If we make all architectures use `long long' then the above code
becomes correct and warning-free on all architectures.
And we then get to remove all the open-coded (unsigned long long) casts
which we added all over the tree (hundreds of them).
> I have done a bit of sparc hacking lately and was wondering if
> sparc needs something similar.
>
> cd arch/sparc
> git grep u64 | grep -v __u64 | wc -l
> 448
>
> [On the unified tree]
Yes, quite a few 64-bit architectures are using `long' for their
s64/u64 types. We should convert them all to `long long'.
That's quite trivial to do, but it causes a lot of warnings due to code
in arch-speciic files which does
printk("%lu", some_u64);
which will then generate a warning. Or an error if the archtiecture
uses -Werror, which several do. So we need to simultaneously convert
all those to %llu. (Or %Lu, which saves a byte :))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists