[PATCH v2] mtd/maps: fix solutionengine.c printk format warnings

From: Randy Dunlap
Date: Sun Jul 22 2018 - 19:29:27 EST


From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Fix 2 printk format warnings (this driver is currently only used by
arch/sh/) by using "%pap" instead of "%lx".
(or we could just cast the physical addresses to unsigned int)

Fixes these build warnings:

../drivers/mtd/maps/solutionengine.c: In function 'init_soleng_maps':
../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
../drivers/mtd/maps/solutionengine.c:62:54: note: format string is defined here
printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
~~~~^
%08x
../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
../drivers/mtd/maps/solutionengine.c:62:72: note: format string is defined here
printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
~~~~^
%08x

Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Brian Norris <computersforpeace@xxxxxxxxx>
Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>
Cc: Marek Vasut <marek.vasut@xxxxxxxxx>
Cc: Richard Weinberger <richard@xxxxxx>
Cc: linux-mtd@xxxxxxxxxxxxxxxxxxx
Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>
Cc: Rich Felker <dalias@xxxxxxxx>
Cc: linux-sh@xxxxxxxxxxxxxxx
Cc: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
---
v2: indent all lines inside the new block

drivers/mtd/maps/solutionengine.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

--- linux-next-20180717.orig/drivers/mtd/maps/solutionengine.c
+++ linux-next-20180717/drivers/mtd/maps/solutionengine.c
@@ -59,9 +59,14 @@ static int __init init_soleng_maps(void)
return -ENXIO;
}
}
- printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
- soleng_flash_map.phys & 0x1fffffff,
- soleng_eprom_map.phys & 0x1fffffff);
+ {
+ resource_size_t fl_phys = soleng_flash_map.phys & 0x1fffffff;
+ resource_size_t ep_phys = soleng_eprom_map.phys & 0x1fffffff;
+
+ printk(KERN_NOTICE
+ "Solution Engine: Flash at 0x%pap, EPROM at 0x%pap\n",
+ &fl_phys, &ep_phys);
+ }
flash_mtd->owner = THIS_MODULE;

eprom_mtd = do_map_probe("map_rom", &soleng_eprom_map);