POWERPC: several build fixes
Subsystems (2)
PATCH 1/1 POWERPC: several build fixes
Fix multiple build errors or warnings for POWERPC. These are mostly fixes for resource_size_t printk format warnings. One patch is for RTAS, which requires GENERIC_ALLOCATOR.
Subject: [PATCH 1/4] clk: mpc512x: fix resource printk format warning
Subject: [PATCH 2/4] powerpc: wii: fix resource printk format warnings
Subject: [PATCH 3/4] powerpc/pseries: RTAS work area requires GENERIC_ALLOCATOR
Subject: [PATCH 4/4] POWERPC: sysdev/tsi108: fix resource printk format warnings
diffstat:
arch/powerpc/platforms/512x/clock-commonclk.c | 2 +- arch/powerpc/platforms/embedded6xx/flipper-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 4 ++-- arch/powerpc/platforms/pseries/Kconfig | 1 + arch/powerpc/sysdev/tsi108_pci.c | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-)
PATCH 1/4 clk: mpc512x: fix resource printk format warning
Use "%pa" format specifier for resource_size_t to avoid a compiler printk format warning.
../arch/powerpc/platforms/512x/clock-commonclk.c: In function 'mpc5121_clk_provide_backwards_compat':../arch/powerpc/platforms/512x/clock-commonclk.c:989:44: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
989 | snprintf(devname, sizeof(devname), "%08x.%s", res.start, np->name); \
| ^~~~~~~~~ ~~~~~~~~~
| |
| resource_size_t {aka long long unsigned int}Prevents 24 such warnings.
--- arch/powerpc/platforms/512x/clock-commonclk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/512x/clock-commonclk.c +1 -1
@@ -986,7 +986,7 @@ static void __init mpc5121_clk_provide_m#define NODE_PREP do { \ of_address_to_resource(np, 0, &res); \ - snprintf(devname, sizeof(devname), "%08x.%s", res.start, np->name); \ + snprintf(devname, sizeof(devname), "%pa.%s", &res.start, np->name); \ } while (0)#define NODE_CHK (clkname, clkitem, regnode, regflag) do { \
PATCH 2/4 powerpc: wii: fix resource printk format warnings
In reply to Randy DunlapUse "%pa" format specifier for resource_size_t to avoid compiler printk format warnings.
../arch/powerpc/platforms/embedded6xx/flipper-pic.c: In function 'flipper_pic_init':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/flipper-pic.c:148:9: note: in expansion of macro 'pr_info'
148 | pr_info("controller at 0x%08x mapped to 0x%p\n", res.start, io_base);
| ^~~~~~~../arch/powerpc/platforms/embedded6xx/hlwd-pic.c: In function 'hlwd_pic_init':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/hlwd-pic.c:174:9: note: in expansion of macro 'pr_info'
174 | pr_info("controller at 0x%08x mapped to 0x%p\n", res.start, io_base);
| ^~~~~~~../arch/powerpc/platforms/embedded6xx/wii.c: In function 'wii_ioremap_hw_regs':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/wii.c:77:17: note: in expansion of macro 'pr_info'
77 | pr_info("%s at 0x%08x mapped to 0x%p\n", name,
| ^~~~~~~--- arch/powerpc/platforms/embedded6xx/flipper-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/embedded6xx/flipper-pic.c +1 -1
@@ -145,7 +145,7 @@ static struct irq_domain * __init flippe } io_base =ioremap (res.start,resource_size (&res)); -pr_info ("controller at 0x%08x mapped to 0x%p\n" , res.start, io_base); +pr_info ("controller at 0x%pa mapped to 0x%p\n" , &res.start, io_base);__flipper_quiesce (io_base);
arch/powerpc/platforms/embedded6xx/wii.c +2 -2
@@ -74,8 +74,8 @@ static void __iomem *__init wii_ioremap_ hw_regs =ioremap (res.start,resource_size (&res));if (hw_regs) { -pr_info ("%s at 0x%08x mapped to 0x%p\n" , name, - res.start, hw_regs); +pr_info ("%s at 0x%pa mapped to 0x%p\n" , name, + &res.start, hw_regs); } out_put:
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +1 -1
@@ -171,7 +171,7 @@ static struct irq_domain *__init hlwd_pireturn NULL ; } -pr_info ("controller at 0x%08x mapped to 0x%p\n" , res.start, io_base); +pr_info ("controller at 0x%pa mapped to 0x%p\n" , &res.start, io_base);__hlwd_quiesce (io_base);
PATCH 3/4 powerpc/pseries: RTAS work area requires GENERIC_ALLOCATOR
In reply to Randy DunlapThe RTAS work area allocator uses code that is built by GENERIC_ALLOCATOR, so the PSERIES Kconfig should select the required Kconfig symbol to fix multiple build errors.
powerpc64-linux-ld: arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.rtas_work_area_allocator_init':
rtas-work-area.c:(.init.text+0x288): undefined reference to `.gen_pool_create'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x2dc): undefined reference to `.gen_pool_set_algo'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x310): undefined reference to `.gen_pool_add_owner'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x43c): undefined reference to `.gen_pool_destroy'
powerpc64-linux-ld: arch/powerpc/platforms/pseries/rtas-work-area.o:(.toc+0x0): undefined reference to `gen_pool_first_fit_order_align'
powerpc64-linux-ld: arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.__rtas_work_area_alloc':
rtas-work-area.c:(.ref.text+0x14c): undefined reference to `.gen_pool_alloc_algo_owner'
powerpc64-linux-ld: rtas-work-area.c:(.ref.text+0x238): undefined reference to `.gen_pool_alloc_algo_owner'
powerpc64-linux-ld: arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.rtas_work_area_free':
rtas-work-area.c:(.ref.text+0x44c): undefined reference to `.gen_pool_free_owner'
--- arch/powerpc/platforms/pseries/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -7,6 +7,7 @@ config PPC_PSERIES select OF_DYNAMIC select FORCE_PCI select PCI_MSI + select GENERIC_ALLOCATOR select PPC_XICS select PPC_XIVE_SPAPR select PPC_ICP_NATIVE
Re: [PATCH 3/4] powerpc/pseries: RTAS work area requires GENERIC_ALLOCATOR
Quoted 16 lines · Randy Dunlap
The RTAS work area allocator uses code that is built by
GENERIC_ALLOCATOR, so the PSERIESKconfigshould select the requiredKconfigsymbol to fix multiple build errors.powerpc64-linux-ld:
arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.rtas_work_area_allocator_init':
rtas-work-area.c:(.init.text+0x288): undefined reference to `.gen_pool_create'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x2dc): undefined reference to `.gen_pool_set_algo'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x310): undefined reference to `.gen_pool_add_owner'
powerpc64-linux-ld: rtas-work-area.c:(.init.text+0x43c): undefined reference to `.gen_pool_destroy'
powerpc64-linux-ld: arch/powerpc/platforms/pseries/rtas-work-area.o:(.toc+0x0): undefined reference to `gen_pool_first_fit_order_align'
powerpc64-linux-ld:arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.__rtas_work_area_alloc':
rtas-work-area.c:(.ref.text+0x14c): undefined reference to `.gen_pool_alloc_algo_owner'
powerpc64-linux-ld: rtas-work-area.c:(.ref.text+0x238): undefined reference to `.gen_pool_alloc_algo_owner'
powerpc64-linux-ld:arch/powerpc/platforms/pseries/rtas-work-area.o: in function `.rtas_work_area_free':
rtas-work-area.c:(.ref.text+0x44c): undefined reference to `.gen_pool_free_owner'
Quoted 2 lines
Fixes 43033bc62d34 ("powerpc/pseries: add RTAS work area allocator")Signed-off-by Randy Dunlap <[email protected]>
oops. Thanks for fixing this.
PATCH 4/4 POWERPC: sysdev/tsi108: fix resource printk format warnings
In reply to Randy DunlapUse "%pa" format specifier for resource_size_t to avoid a compiler printk format warning.
../arch/powerpc/sysdev/tsi108_pci.c: In function 'tsi108_setup_pci':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
--- arch/powerpc/sysdev/tsi108_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/tsi108_pci.c +2 -2
@@ -217,9 +217,9 @@ int __init tsi108_setup_pci(struct devic (hose)->ops = &tsi108_direct_pci_ops; -printk (KERN_INFO "Found tsi108 PCI host bridge at 0x%08x. " +printk (KERN_INFO "Found tsi108 PCI host bridge at 0x%pa. " "Firmware bus number: %d->%d\n" , - rsrc.start, hose->first_busno, hose->last_busno); + &rsrc.start, hose->first_busno, hose->last_busno);/* Interpret the "ranges" property */ /* This also maps the I/O region and sets isa_io/mem_base */