linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: renesas: fdp1: Use %pe format specifier
@ 2025-10-20  7:53 Ricardo Ribalda
  2025-10-20  7:57 ` Kieran Bingham
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Ribalda @ 2025-10-20  7:53 UTC (permalink / raw)
  To: Kieran Bingham, Mauro Carvalho Chehab, Geert Uytterhoeven,
	Magnus Damm
  Cc: linux-media, linux-renesas-soc, linux-kernel, Ricardo Ribalda

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR()

This patch fixes this cocci report:
./platform/renesas/rcar_fdp1.c:2303:4-11: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
It seems that we missed this file from the original patchset.
https://lore.kernel.org/linux-media/20251013-ptr_err-v1-0-2c5efbd82952@chromium.org/
---
 drivers/media/platform/renesas/rcar_fdp1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
index 3515601030eccefe3d979303893c93c85ab0a9b2..672869815f636de25ce08261bf327f156b617a37 100644
--- a/drivers/media/platform/renesas/rcar_fdp1.c
+++ b/drivers/media/platform/renesas/rcar_fdp1.c
@@ -2299,8 +2299,7 @@ static int fdp1_probe(struct platform_device *pdev)
 		fdp1->fcp = rcar_fcp_get(fcp_node);
 		of_node_put(fcp_node);
 		if (IS_ERR(fdp1->fcp)) {
-			dev_dbg(&pdev->dev, "FCP not found (%ld)\n",
-				PTR_ERR(fdp1->fcp));
+			dev_dbg(&pdev->dev, "FCP not found (%pe)\n", fdp1->fcp);
 			return PTR_ERR(fdp1->fcp);
 		}
 	}

---
base-commit: 8652359fc004cbadbf0e95692c1472caac6260c2
change-id: 20251020-ptr_err-leftover-1997b3a6e06e

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


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

* Re: [PATCH] media: renesas: fdp1: Use %pe format specifier
  2025-10-20  7:53 [PATCH] media: renesas: fdp1: Use %pe format specifier Ricardo Ribalda
@ 2025-10-20  7:57 ` Kieran Bingham
  2025-10-20  8:00   ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Kieran Bingham @ 2025-10-20  7:57 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Mauro Carvalho Chehab,
	Ricardo Ribalda
  Cc: linux-media, linux-renesas-soc, linux-kernel, Ricardo Ribalda

Quoting Ricardo Ribalda (2025-10-20 08:53:41)
> The %pe format specifier is designed to print error pointers. It prints
> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> omitting PTR_ERR()
> 
> This patch fixes this cocci report:
> ./platform/renesas/rcar_fdp1.c:2303:4-11: WARNING: Consider using %pe to print PTR_ERR()
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks, same as the others:

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
> It seems that we missed this file from the original patchset.
> https://lore.kernel.org/linux-media/20251013-ptr_err-v1-0-2c5efbd82952@chromium.org/
> ---
>  drivers/media/platform/renesas/rcar_fdp1.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
> index 3515601030eccefe3d979303893c93c85ab0a9b2..672869815f636de25ce08261bf327f156b617a37 100644
> --- a/drivers/media/platform/renesas/rcar_fdp1.c
> +++ b/drivers/media/platform/renesas/rcar_fdp1.c
> @@ -2299,8 +2299,7 @@ static int fdp1_probe(struct platform_device *pdev)
>                 fdp1->fcp = rcar_fcp_get(fcp_node);
>                 of_node_put(fcp_node);
>                 if (IS_ERR(fdp1->fcp)) {
> -                       dev_dbg(&pdev->dev, "FCP not found (%ld)\n",
> -                               PTR_ERR(fdp1->fcp));
> +                       dev_dbg(&pdev->dev, "FCP not found (%pe)\n", fdp1->fcp);
>                         return PTR_ERR(fdp1->fcp);
>                 }
>         }
> 
> ---
> base-commit: 8652359fc004cbadbf0e95692c1472caac6260c2
> change-id: 20251020-ptr_err-leftover-1997b3a6e06e
> 
> Best regards,
> -- 
> Ricardo Ribalda <ribalda@chromium.org>
>

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

* Re: [PATCH] media: renesas: fdp1: Use %pe format specifier
  2025-10-20  7:57 ` Kieran Bingham
@ 2025-10-20  8:00   ` Hans Verkuil
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2025-10-20  8:00 UTC (permalink / raw)
  To: Kieran Bingham, Geert Uytterhoeven, Magnus Damm,
	Mauro Carvalho Chehab, Ricardo Ribalda
  Cc: linux-media, linux-renesas-soc, linux-kernel

On 20/10/2025 09:57, Kieran Bingham wrote:
> Quoting Ricardo Ribalda (2025-10-20 08:53:41)
>> The %pe format specifier is designed to print error pointers. It prints
>> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
>> omitting PTR_ERR()
>>
>> This patch fixes this cocci report:
>> ./platform/renesas/rcar_fdp1.c:2303:4-11: WARNING: Consider using %pe to print PTR_ERR()
>>
>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> 
> Thanks, same as the others:
> 
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

I'll try to fast-track this patch today. It's good to get this all in.

Regards,

	Hans

> 
>> ---
>> It seems that we missed this file from the original patchset.
>> https://lore.kernel.org/linux-media/20251013-ptr_err-v1-0-2c5efbd82952@chromium.org/
>> ---
>>  drivers/media/platform/renesas/rcar_fdp1.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
>> index 3515601030eccefe3d979303893c93c85ab0a9b2..672869815f636de25ce08261bf327f156b617a37 100644
>> --- a/drivers/media/platform/renesas/rcar_fdp1.c
>> +++ b/drivers/media/platform/renesas/rcar_fdp1.c
>> @@ -2299,8 +2299,7 @@ static int fdp1_probe(struct platform_device *pdev)
>>                 fdp1->fcp = rcar_fcp_get(fcp_node);
>>                 of_node_put(fcp_node);
>>                 if (IS_ERR(fdp1->fcp)) {
>> -                       dev_dbg(&pdev->dev, "FCP not found (%ld)\n",
>> -                               PTR_ERR(fdp1->fcp));
>> +                       dev_dbg(&pdev->dev, "FCP not found (%pe)\n", fdp1->fcp);
>>                         return PTR_ERR(fdp1->fcp);
>>                 }
>>         }
>>
>> ---
>> base-commit: 8652359fc004cbadbf0e95692c1472caac6260c2
>> change-id: 20251020-ptr_err-leftover-1997b3a6e06e
>>
>> Best regards,
>> -- 
>> Ricardo Ribalda <ribalda@chromium.org>
>>
> 


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

end of thread, other threads:[~2025-10-20  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20  7:53 [PATCH] media: renesas: fdp1: Use %pe format specifier Ricardo Ribalda
2025-10-20  7:57 ` Kieran Bingham
2025-10-20  8:00   ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).