On Mon Oct 13 14:14:52 2025 +0000, Ricardo Ribalda wrote:
> 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:
> ./i2c/max9286.c:755:7-14: WARNING: Consider using %pe to print PTR_ERR()
> 
> Signed-off-by: Ricardo Ribalda <[email protected]>
> Reviewed-by: Kieran Bingham <[email protected]>
> Acked-by: Sakari Ailus <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/i2c/max9286.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 7c0961688d61..e6e214f8294b 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -751,8 +751,8 @@ static int max9286_v4l2_notifier_register(struct 
max9286_priv *priv)
                mas = v4l2_async_nf_add_fwnode(&priv->notifier, source->fwnode,
                                               struct max9286_asd);
                if (IS_ERR(mas)) {
-                       dev_err(dev, "Failed to add subdev for source %u: %ld",
-                               i, PTR_ERR(mas));
+                       dev_err(dev, "Failed to add subdev for source %u: %pe",
+                               i, mas);
                        v4l2_async_nf_cleanup(&priv->notifier);
                        return PTR_ERR(mas);
                }
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to