soc: ixp4xx: fix printing resources
PATCH 1/1 soc: ixp4xx: fix printing resources
From: Arnd Bergmann <[email protected]>
When compile-testing with 64-bit resource_size_t, gcc reports an invalid printk format string:
In file included from include/linux/dma-mapping.h:7,
from drivers/soc/ixp4xx/ixp4xx-npe.c:15:
drivers/soc/ixp4xx/ixp4xx-npe.c: In function 'ixp4xx_npe_probe':
drivers/soc/ixp4xx/ixp4xx-npe.c:694:18: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
dev_info(dev, "NPE%d at 0x%08x-0x%08x not available\n",Use the special %pR format string to print the resources.
Fixes 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources")
Signed-off-by Arnd Bergmann <[email protected]>
--- drivers/soc/ixp4xx/ixp4xx-npe.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/soc/ixp4xx/ixp4xx-npe.c +5 -6
@@ -693,8 +693,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev)if (!(ixp4xx_read_feature_bits () & (IXP4XX_FEATURE_RESET_NPEA << i))) { -dev_info (dev,"NPE%d at 0x%08x-0x%08x not available\n" , - i, res->start, res->end); +dev_info (dev,"NPE%d at %pR not available\n" , + i, res);continue ;/* NPE already disabled or not present */ } npe->regs =devm_ioremap_resource (dev, res);
@@ -702,13 +702,12 @@ static int ixp4xx_npe_probe(struct platform_device *pdev)return PTR_ERR (npe->regs);if (npe_reset (npe)) { -dev_info (dev,"NPE%d at 0x%08x-0x%08x does not reset\n" , - i, res->start, res->end); +dev_info (dev,"NPE%d at %pR does not reset\n" , + i, res);continue ; } npe->valid =1 ; -dev_info (dev,"NPE%d at 0x%08x-0x%08x registered\n" , - i, res->start, res->end); +dev_info (dev,"NPE%d at %pR registered\n" , i, res); found++; }
Signature · 1 line
2.29.2
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When compile-testing with 64-bit
resource_size_t, gcc reports an invalid printk format string:In file included from
include/linux/dma-mapping.h:7,from drivers/soc/ixp4xx/ixp4xx-npe.c:15: drivers/soc/ixp4xx/ixp4xx-npe.c: In function 'ixp4xx_npe_probe': drivers/soc/ixp4xx/ixp4xx-npe.c:694:18: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] dev_info(dev, "NPE%d at 0x%08x-0x%08x not available\n",
Quoted 4 lines
Use the special %pR format string to print the resources.
Fixes 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources")Signed-off-by Arnd Bergmann <[email protected]>
Reviewed-by Linus Walleij <[email protected]>
Yours,
Linus Walleij