On Mon Oct 13 14:14:50 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/imx335.c:1013:3-10: 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/imx335.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index c043df2f15fb..71ed9a0d84a2 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -1009,8 +1009,8 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
        imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
                                                     GPIOD_OUT_HIGH);
        if (IS_ERR(imx335->reset_gpio)) {
-               dev_err(imx335->dev, "failed to get reset gpio %ld\n",
-                       PTR_ERR(imx335->reset_gpio));
+               dev_err(imx335->dev, "failed to get reset gpio %pe\n",
+                       imx335->reset_gpio);
                return PTR_ERR(imx335->reset_gpio);
        }
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to