From: Andy Whitcroft <apw@shadowen.org>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Jan Beulich <jbeulich@novell.com>,
Randy Dunlap <rdunlap@xenotime.net>,
Joel Schopp <jschopp@austin.ibm.com>,
Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] checkpatch: Check for %L for all integer formats (was: Re: [PATCH] fix printk format compiler warnings)
Date: Tue, 30 Sep 2008 14:14:40 +0100 [thread overview]
Message-ID: <20080930131440.GM14905@brain> (raw)
In-Reply-To: <Pine.LNX.4.64.0809301314270.6954@vixen.sonytel.be>
On Tue, Sep 30, 2008 at 01:29:44PM +0200, Geert Uytterhoeven wrote:
> On Fri, 5 Sep 2008, Jan Beulich wrote:
> > %llx and the like cannot be used on u64-derived data types - they must
> > be cast to long long explicitly for arch-es where u64 is a typedef of
> > unsigned long (ia64 is where I observed the problem).
>
> > - printk(KERN_INFO "PCI: bridge %s io port: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
> > + printk(KERN_INFO "PCI: bridge %s io port: [%Lx, %Lx]\n",
>
> > - printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
> > + printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%Lx, %Lx]\n",
>
> > - printk(KERN_INFO "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",res->start, res->end);
> > + printk(KERN_INFO "PCI: bridge %s %dbit mmio pref: [%Lx, %Lx]\n",
>
> > - printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end);
> > + printk(KERN_INFO "bus: %02x index %x %s: [%Lx, %Lx]\n",
>
> Why did you replace `%ll' by `%L'?
>
> While `L' is used as an internal flag in Linux' vsnprintf() implementation and
> is still supported because of historical (pre-C99) reasons, the `L' conversion
> qualifier is meant for the `long double' floating point type, as per C99.
> The recommended conversion qualifier for the `long long' integer type is `ll'.
>
> Perhaps checkpatch should check for this? Ah, it already does for some of the
> integer formats. The patch below adds checks for the missing ones.
[...]
Yes that looks entirly reasonable to me. Will queue it up with my next
batch for Andrew.
Thanks.
-apw
next prev parent reply other threads:[~2008-09-30 13:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-05 12:06 [PATCH] fix printk format compiler warnings Jan Beulich
2008-09-05 21:20 ` Andrew Morton
2008-09-09 4:54 ` Jesse Barnes
2008-09-30 11:29 ` [PATCH] checkpatch: Check for %L for all integer formats (was: Re: [PATCH] fix printk format compiler warnings) Geert Uytterhoeven
2008-09-30 13:14 ` Andy Whitcroft [this message]
2008-09-30 15:32 ` [PATCH] checkpatch: Check for %L for all integer formats (was: " Jan Beulich
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=20080930131440.GM14905@brain \
--to=apw@shadowen.org \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=jbeulich@novell.com \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.