Skip to contentSkip to conversation

drm/tiny: print 'struct resource *' correctly

PATCH In review Yussef Dalton 2 participants 3 messages Oct 15, 2023 – Dec 16, 2023

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

PATCH 1/1 drm/tiny: print 'struct resource *' correctly

Since format specifier %pr refers to a 'struct resource *', there is no need to take the address of the 'res' variable since it is already of type 'struct resource *'.

---
 drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/ofdrm.c +2 -2
index 2d999a0facde..6372ab383747 100644
@@ -1208,13 +1208,13 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
 
 	ret = devm_aperture_acquire_from_firmware(dev, fb_pgbase, fb_pgsize);
 	if (ret) {
-		drm_err(dev, "could not acquire memory range %pr: error %d\n", &res, ret);
+		drm_err(dev, "could not acquire memory range %pr: error %d\n", res, ret);
 		return ERR_PTR(ret);
 	}
 
 	mem = devm_request_mem_region(&pdev->dev, fb_pgbase, fb_pgsize, drv->name);
 	if (!mem) {
-		drm_warn(dev, "could not acquire memory region %pr\n", &res);
+		drm_warn(dev, "could not acquire memory region %pr\n", res);
 		return ERR_PTR(-ENOMEM);
 	}
 
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yussef Dalton

Since format specifier %pr refers to a 'struct resource *', there is no need to take the address of the 'res' variable since it is already of type 'struct resource *'.

Thanks.

Quoted 24 lines
---
 drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/ofdrm.c +2 -2
index 2d999a0facde..6372ab383747 100644
@@ -1208,13 +1208,13 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
 
 	ret = devm_aperture_acquire_from_firmware(dev, fb_pgbase, fb_pgsize);
 	if (ret) {
-		drm_err(dev, "could not acquire memory range %pr: error %d\n", &res, ret);
+		drm_err(dev, "could not acquire memory range %pr: error %d\n", res, ret);
 		return ERR_PTR(ret);
 	}
 
 	mem = devm_request_mem_region(&pdev->dev, fb_pgbase, fb_pgsize, drv->name);
 	if (!mem) {
-		drm_warn(dev, "could not acquire memory region %pr\n", &res);
+		drm_warn(dev, "could not acquire memory region %pr\n", res);
 		return ERR_PTR(-ENOMEM);
 	}
 
Signature · 1 line
~Randy
#2 lore raw
Quoted 30 lines · Randy Dunlap
Quoted 5 lines · Yussef Dalton

Since format specifier %pr refers to a 'struct resource *', there is no need to take the address of the 'res' variable since it is already of type 'struct resource *'.

Thanks.

Quoted 17 lines
---
  drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/ofdrm.c +1 -1
index 2d999a0facde..6372ab383747 100644
@@ -1208,13 +1208,13 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
 
  	ret = devm_aperture_acquire_from_firmware(dev, fb_pgbase, fb_pgsize);
  	if (ret) {
-		drm_err(dev, "could not acquire memory range %pr: error %d\n", &res, ret);
+		drm_err(dev, "could not acquire memory range %pr: error %d\n", res, ret);
  		return ERR_PTR(ret);
  	}
 
Quoted 8 lines

drivers/gpu/drm/tiny/ofdrm.c static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv, · line 1220

Quoted 7 lines
drivers/gpu/drm/tiny/ofdrm.c +1 -1
  	mem = devm_request_mem_region(&pdev->dev, fb_pgbase, fb_pgsize, drv->name);
  	if (!mem) {
-		drm_warn(dev, "could not acquire memory region %pr\n", &res);
+		drm_warn(dev, "could not acquire memory region %pr\n", res);
  		return ERR_PTR(-ENOMEM);
  	}
 

Hi,

Sorry for the bump, but is there any news on my patch?

Regards,

Yussef