Thread (47 messages) 47 messages, 10 authors, 2025-10-17

Re: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier

From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Date: 2025-10-13 15:03:30
Also in: imx, linux-media, linux-renesas-soc, linux-samsung-soc, linux-staging, lkml

Quoting Ricardo Ribalda (2025-10-13 15:14:50)
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()
Ohhh nice. Is this new ? First I've come across it.


quoted hunk ↗ jump to hunk
Signed-off-by: Ricardo Ribalda <redacted>
---
 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 c043df2f15fb25b3a56422092f99a1fd9a508fa9..71ed9a0d84a252ee362621c4d38001508fb86d28 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);
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
                return PTR_ERR(imx335->reset_gpio);
        }
 

-- 
2.51.0.760.g7b8bcc2412-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help