From: Andrew Morton <akpm@linux-foundation.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: mingo@elte.hu, sfr@canb.auug.org.au,
linux-kernel@vger.kernel.org, kenchen@google.com,
paulus@samba.org, tglx@linutronix.de, hpa@zytor.com,
linux-next@vger.kernel.org, davem@davemloft.net
Subject: Re: [patch] powerpc: change u64/s64 to a long long integer type
Date: Mon, 22 Dec 2008 15:13:38 -0800 [thread overview]
Message-ID: <20081222151338.3b6ef997.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081222230035.GB4074@uranus.ravnborg.org>
On Tue, 23 Dec 2008 00:00:35 +0100
Sam Ravnborg <sam@ravnborg.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@elte.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 :))
next prev parent reply other threads:[~2008-12-22 23:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-22 4:22 linux-next: sched tree build warning Stephen Rothwell
2008-12-22 6:47 ` Ingo Molnar
2008-12-22 6:49 ` Ken Chen
2008-12-22 7:04 ` Ingo Molnar
2008-12-22 7:19 ` Stephen Rothwell
2008-12-22 8:03 ` [patch] powerpc: change u64/s64 to a long long integer type Ingo Molnar
2008-12-22 22:43 ` Andrew Morton
2008-12-22 23:00 ` Sam Ravnborg
2008-12-22 23:03 ` H. Peter Anvin
2008-12-22 23:13 ` Sam Ravnborg
2008-12-22 23:13 ` Andrew Morton [this message]
2008-12-23 13:17 ` [PATCH] sparc64: use unsigned long long for u64 Sam Ravnborg
2008-12-23 14:42 ` [PATCH] sparc64: fix unsigned long long warnings in drivers Sam Ravnborg
2008-12-23 17:05 ` [PATCH] sparc64: use unsigned long long for u64 Ken Chen
2008-12-23 17:26 ` Sam Ravnborg
2008-12-23 17:29 ` Ken Chen
2008-12-23 17:34 ` Sam Ravnborg
2008-12-27 8:54 ` David Miller
2008-12-27 9:24 ` Sam Ravnborg
2008-12-27 9:37 ` David Miller
2008-12-27 9:49 ` Sam Ravnborg
2008-12-28 4:25 ` David Miller
2008-12-28 12:32 ` Sam Ravnborg
2008-12-31 4:40 ` [patch] powerpc: change u64/s64 to a long long integer type Stephen Rothwell
2008-12-31 7:52 ` Ingo Molnar
2008-12-22 8:14 ` linux-next: sched tree build warning Paul Mackerras
2008-12-22 8:18 ` Ingo Molnar
2008-12-22 9:44 ` Paul Mackerras
2008-12-22 10:53 ` Ingo Molnar
2008-12-22 12:03 ` Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081222151338.3b6ef997.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=kenchen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=sam@ravnborg.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).