2023-10-15 13:11:55

by Yussef Dalton

[permalink] [raw]
Subject: [PATCH] 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 *'.

Signed-off-by: Yussef Dalton <[email protected]>
---
drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c
index 2d999a0facde..6372ab383747 100644
--- a/drivers/gpu/drm/tiny/ofdrm.c
+++ b/drivers/gpu/drm/tiny/ofdrm.c
@@ -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);
}

--
2.41.0


2023-10-15 15:35:39

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] drm/tiny: print 'struct resource *' correctly



On 10/15/23 06:11, Yussef Dalton wrote:
> 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 *'.
>
> Signed-off-by: Yussef Dalton <[email protected]>

Reviewed-by: Randy Dunlap <[email protected]>

Thanks.

> ---
> drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c
> index 2d999a0facde..6372ab383747 100644
> --- a/drivers/gpu/drm/tiny/ofdrm.c
> +++ b/drivers/gpu/drm/tiny/ofdrm.c
> @@ -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);
> }
>

--
~Randy

2023-12-16 23:12:29

by Yussef Dalton

[permalink] [raw]
Subject: Re: [PATCH] drm/tiny: print 'struct resource *' correctly

On 10/15/23 17:35, Randy Dunlap wrote:
>
>
> On 10/15/23 06:11, Yussef Dalton wrote:
>> 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 *'.
>>
>> Signed-off-by: Yussef Dalton <[email protected]>
>
> Reviewed-by: Randy Dunlap <[email protected]>
>
> Thanks.
>
>> ---
>> drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c
>> index 2d999a0facde..6372ab383747 100644
>> --- a/drivers/gpu/drm/tiny/ofdrm.c
>> +++ b/drivers/gpu/drm/tiny/ofdrm.c
>> @@ -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);
>> }
>>
>

Hi,

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

Regards,

Yussef