All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] drm: simpledrm: print resource info using '%pr'
@ 2021-05-12 23:34 ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-05-12 23:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Thomas Zimmermann, dri-devel

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")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/tiny/simpledrm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20210512.orig/drivers/gpu/drm/tiny/simpledrm.c
+++ linux-next-20210512/drivers/gpu/drm/tiny/simpledrm.c
@@ -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;
 	}
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH -next] drm: simpledrm: print resource info using '%pr'
@ 2021-05-12 23:34 ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-05-12 23:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, dri-devel, Thomas Zimmermann

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")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/tiny/simpledrm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20210512.orig/drivers/gpu/drm/tiny/simpledrm.c
+++ linux-next-20210512/drivers/gpu/drm/tiny/simpledrm.c
@@ -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;
 	}
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] drm: simpledrm: print resource info using '%pr'
  2021-05-12 23:34 ` Randy Dunlap
  (?)
@ 2021-05-13 13:03 ` Thomas Zimmermann
  -1 siblings, 0 replies; 3+ messages in thread
From: Thomas Zimmermann @ 2021-05-13 13:03 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2477 bytes --]

Hi

Am 13.05.21 um 01:34 schrieb Randy Dunlap:
> 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")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org

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

Best regards
Thomas

> ---
>   drivers/gpu/drm/tiny/simpledrm.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- linux-next-20210512.orig/drivers/gpu/drm/tiny/simpledrm.c
> +++ linux-next-20210512/drivers/gpu/drm/tiny/simpledrm.c
> @@ -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;
>   	}
>   
> 

-- 
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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-13 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 23:34 [PATCH -next] drm: simpledrm: print resource info using '%pr' Randy Dunlap
2021-05-12 23:34 ` Randy Dunlap
2021-05-13 13:03 ` Thomas Zimmermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.