Skip to contentSkip to conversation

drm: simpledrm: print resource info using '%pr'

PATCH Applied Randy Dunlap 2 participants 2 messages May 12, 2021 – May 13, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: simpledrm: print resource info using '%pr'

struct resource start and end fields are not always long long, so using %llx to print them can cause build warnings (below). Fix these by using the special "%pr" for printing struct resource info.

../drivers/gpu/drm/tiny/simpledrm.c: In function ‘simpledrm_device_init_mm’:
../include/drm/drm_print.h:412:32: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘resource_size_t {aka unsigned int}’ [-Wformat=] ../drivers/gpu/drm/tiny/simpledrm.c:533:54: note: format string is defined here
drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error %d\n",

                                                   ~~~^
                                                   %x
../include/drm/drm_print.h:412:32: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘resource_size_t {aka unsigned int}’ [-Wformat=]
../drivers/gpu/drm/tiny/simpledrm.c:533:61: note: format string is defined here
   drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error %d\n",
                                                          ~~~^
                                                          %x
Fixes 4aae79f77e3a ("drm/simpledrm: Acquire memory aperture for framebuffer")
Cc Thomas Zimmermann <[email protected]>
---
 drivers/gpu/drm/tiny/simpledrm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +2 -2
@@ -530,8 +530,8 @@ static int simpledrm_device_init_mm(stru
 
 	ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem));
 	if (ret) {
-		drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error %d\n",
-			mem->start, mem->end, ret);
+		drm_err(dev, "could not acquire memory range %pr: error %d\n",
+			mem, ret);
 		return ret;
 	}
 
maintainer Applied
#1 lore raw

Hi

Am 13.05.21 um 01:34 schrieb Randy Dunlap:

Quoted 6 lines

struct resource start and end fields are not always long long, so using %llx to print them can cause build warnings (below). Fix these by using the special "%pr" for printing struct resource info.

../drivers/gpu/drm/tiny/simpledrm.c: In function ‘simpledrm_device_init_mm’:
../include/drm/drm_print.h:412:32: warning: format ‘%llx’

expects argument of type ‘long long unsigned int’, but argument 3 has type ‘resource_size_t {aka unsigned int}’ [-Wformat=]

Quoted 2 lines

../drivers/gpu/drm/tiny/simpledrm.c:533:54: note: format string is defined here

    drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error 

%d\n",

Quoted 3 lines
                                                    ~~~^
                                                    %x

../include/drm/drm_print.h:412:32: warning: format ‘%llx’

expects argument of type ‘long long unsigned int’, but argument 4 has type ‘resource_size_t {aka unsigned int}’ [-Wformat=]

Quoted 2 lines

../drivers/gpu/drm/tiny/simpledrm.c:533:61: note: format string is defined here

    drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error 

%d\n",

Quoted 7 lines
                                                           ~~~^
                                                           %x
Fixes 4aae79f77e3a ("drm/simpledrm: Acquire memory aperture for framebuffer")
Cc Thomas Zimmermann <[email protected]>

Queued up for drm-misc-next. Thanks a lot.

Best regards
Thomas

Quoted 18 lines
---
  drivers/gpu/drm/tiny/simpledrm.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +2 -2
@@ -530,8 +530,8 @@ static int simpledrm_device_init_mm(stru
 
  	ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem));
  	if (ret) {
-		drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error %d\n",
-			mem->start, mem->end, ret);
+		drm_err(dev, "could not acquire memory range %pr: error %d\n",
+			mem, ret);
  		return ret;
  	}
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer