]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: max9286: Use %pe format specifier
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 13 Oct 2025 14:14:52 +0000 (14:14 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Fri, 17 Oct 2025 09:31:15 +0000 (11:31 +0200)
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 <ribalda@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/max9286.c

index 7c0961688d6173843f3ae846253d4a8669ae762b..e6e214f8294b83105be02f29966e1d3ed72f8dbe 100644 (file)
@@ -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);
                }