EDAC/aspeed: use proper format string for printing resource
Subsystems (3)
PATCH 1/1 EDAC/aspeed: use proper format string for printing resource
From: Arnd Bergmann <[email protected]>
On ARMv7, resource_size_t can be 64-bit, which breaks printing it as %x:
drivers/edac/aspeed_edac.c: In function 'init_csrows':drivers/edac/aspeed_edac.c:257:28: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
Use the special %pR format string to pretty-print the entire resource instead.
--- drivers/edac/aspeed_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/aspeed_edac.c +2 -2
@@ -254,8 +254,8 @@ static int init_csrows(struct mem_ctl_info *mci)return rc; } -dev_dbg (mci->pdev,"dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n" , - r.start,resource_size (&r),PAGE_SHIFT ); +dev_dbg (mci->pdev,"dt: /memory node resources: first page %pR, PAGE_SHIFT macro=0x%x\n" , + &r,PAGE_SHIFT ); csrow->first_page = r.start >>PAGE_SHIFT ; nr_pages =resource_size (&r) >>PAGE_SHIFT ;
Signature · 1 line
2.29.2
Quoted 26 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
On ARMv7,
resource_size_tcan be 64-bit, which breaks printing it as %x:
drivers/edac/aspeed_edac.c: In function 'init_csrows':drivers/edac/aspeed_edac.c:257:28: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first
page r.start=0x%x, resource_size=0x%x,PAGE_SHIFTmacro=0x%x\n",Use the special %pR format string to pretty-print the entire resource instead.
Fixes edfc2d73ca45 ("EDAC/aspeed: Add support for AST2400 and AST2600")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/edac/aspeed_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/aspeed_edac.c +0
-0
drivers/edac/aspeed_edac.c static int init_csrows(struct mem_ctl_info *mci) · line 258
Quoted 7 lines
drivers/edac/aspeed_edac.c +1
-2@@ -254,8 +254,8 @@ static int init_csrows(struct mem_ctl_info *mci)return rc; } - dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n", - r.start, resource_size(&r), PAGE_SHIFT); + dev_dbg(mci->pdev, "dt: /memory node resources: first page %pR, PAGE_SHIFT macro=0x%x\n",
Could probably drop the "first page " as well, but it's a dev_dbg() and not a big deal.
Quoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
On ARMv7,
resource_size_tcan be 64-bit, which breaks printing it as %x:
drivers/edac/aspeed_edac.c: In function 'init_csrows':drivers/edac/aspeed_edac.c:257:28: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
257 | dev_dbg(mci->pdev, "dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x,PAGE_SHIFTmacro=0x%x\n",Use the special %pR format string to pretty-print the entire resource instead.
Fixes edfc2d73ca45 ("EDAC/aspeed: Add support for AST2400 and AST2600")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/edac/aspeed_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/aspeed_edac.c +0
-0
drivers/edac/aspeed_edac.c static int init_csrows(struct mem_ctl_info *mci) · line 261
Quoted 10 lines
drivers/edac/aspeed_edac.c +2
-2@@ -254,8 +254,8 @@ static int init_csrows(struct mem_ctl_info *mci)return rc; } -dev_dbg (mci->pdev,"dt: /memory node resources: first page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n" , - r.start,resource_size (&r),PAGE_SHIFT ); +dev_dbg (mci->pdev,"dt: /memory node resources: first page %pR, PAGE_SHIFT macro=0x%x\n" , + &r,PAGE_SHIFT ); csrow->first_page = r.start >>PAGE_SHIFT ; nr_pages =resource_size (&r) >>PAGE_SHIFT ;
Applied, thanks.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette