Re: [PATCH] PCI: v3-semi: print resources using %pR format string

From: Linus Walleij
Date: Wed Oct 11 2017 - 15:04:44 EST


On Wed, Oct 11, 2017 at 4:02 PM, Arnd Bergmann <arnd@xxxxxxxx> wrote:

> A resource_size_t can be 32 or 64 bit on arm32, causing a number
> of warnings for incorrect format strings:
>
> In file included from include/linux/printk.h:327:0,
> from include/linux/kernel.h:13,
> from include/linux/interrupt.h:5,
> from drivers/pci/host/pci-v3-semi.c:19:
> drivers/pci/host/pci-v3-semi.c: In function 'v3_pci_setup_resource':
> drivers/pci/host/pci-v3-semi.c:536:4: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'phys_addr_t {aka long long unsigned int}' [-Werror=format=]
> "I/O window start %08x, bus addr %08x, size %08x\n",
> drivers/pci/host/pci-v3-semi.c:536:4: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
>
> The best way to print this instead is to pass the resource itself
> to printk as a pointerm, using the special '%pR' format string
> for pretty-printing the range.
>
> For the bus address, we use %pap, respectively.
>
> Fixes: 132d10e24ff3 ("PCI: v3-semi: Add V3 Semiconductor PCI host driver")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Ah this again.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Sorry about it, is it that checkpatch doesn't warn for this?

Yours,
Linus Walleij