Skip to contentSkip to conversation

drm/tiny: correctly print `struct resource *` on error

PATCH In review Joey Gouly 2 participants 3 messages Oct 10, 2023 – Oct 12, 2023

Subsystems (2)
lore
Share & tools
lore

Joey Gouly

author
#0 lore raw

PATCH 1/1 drm/tiny: correctly print `struct resource *` on error

The res variable is already a struct resource *, don't take the address of it.

Fixes incorrect output:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [??? 0xffff4be88a387d00-0xfffffefffde0a240 flags 0x0]: -16

To be correct:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [mem 0x9e20dc000-0x9e307bfff flags 0x200]: -16
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
---
 drivers/gpu/drm/tiny/simpledrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tiny/simpledrm.c +1 -1
index ff86ba1ae1b8..8ea120eb8674 100644
@@ -745,7 +745,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
 
 		ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res));
 		if (ret) {
-			drm_err(dev, "could not acquire memory range %pr: %d\n", &res, ret);
+			drm_err(dev, "could not acquire memory range %pr: %d\n", res, ret);
 			return ERR_PTR(ret);
 		}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 10.10.23 um 19:46 schrieb Joey Gouly:

Quoted 6 lines

The res variable is already a struct resource *, don't take the address of it.

Fixes incorrect output:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [??? 0xffff4be88a387d00-0xfffffefffde0a240 flags 0x0]: -16
Quoted 7 lines

To be correct:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [mem 0x9e20dc000-0x9e307bfff flags 0x200]: -16
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>

Thanks for the patch.

Quoted 17 lines
---
  drivers/gpu/drm/tiny/simpledrm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tiny/simpledrm.c +1 -1
index ff86ba1ae1b8..8ea120eb8674 100644
@@ -745,7 +745,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
 
  		ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res));
  		if (ret) {
-			drm_err(dev, "could not acquire memory range %pr: %d\n", &res, ret);
+			drm_err(dev, "could not acquire memory range %pr: %d\n", res, ret);
  			return ERR_PTR(ret);
  		}
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#2 lore raw
In reply to Joey Gouly

Hi

Am 10.10.23 um 19:46 schrieb Joey Gouly:

Quoted 6 lines

The res variable is already a struct resource *, don't take the address of it.

Fixes incorrect output:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [??? 0xffff4be88a387d00-0xfffffefffde0a240 flags 0x0]: -16
Quoted 7 lines

To be correct:

	simple-framebuffer 9e20dc000.framebuffer: [drm] *ERROR* could not acquire memory range [mem 0x9e20dc000-0x9e307bfff flags 0x200]: -16
Cc Thomas Zimmermann <[email protected]>
Cc Javier Martinez Canillas <[email protected]>

It's a bug fix. I'm going to merge this patch into drm-misc-fixes with the following additional tags:

Fixes 9a10c7e6519b ("drm/simpledrm: Add support for system memory framebuffers")
Cc Thierry Reding <[email protected]>
Cc <[email protected]> # v6.3+

Best regards
Thomas

Quoted 17 lines
---
  drivers/gpu/drm/tiny/simpledrm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tiny/simpledrm.c +1 -1
index ff86ba1ae1b8..8ea120eb8674 100644
@@ -745,7 +745,7 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
 
  		ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res));
  		if (ret) {
-			drm_err(dev, "could not acquire memory range %pr: %d\n", &res, ret);
+			drm_err(dev, "could not acquire memory range %pr: %d\n", res, ret);
  			return ERR_PTR(ret);
  		}
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)