On Mon Oct 13 14:14:55 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/mt9v111.c:1143:3-10: WARNING: Consider using %pe to print PTR_ERR()
> ./i2c/mt9v111.c:1151:3-10: WARNING: Consider using %pe to print PTR_ERR()
> ./i2c/mt9v111.c:1159:3-10: WARNING: Consider using %pe to print PTR_ERR()
> 
> Signed-off-by: Ricardo Ribalda <[email protected]>
> Acked-by: Sakari Ailus <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/i2c/mt9v111.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

---

diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c
index b4f2703faa18..64a758c95ab7 100644
--- a/drivers/media/i2c/mt9v111.c
+++ b/drivers/media/i2c/mt9v111.c
@@ -1139,24 +1139,24 @@ static int mt9v111_probe(struct i2c_client *client)
        mt9v111->oe = devm_gpiod_get_optional(&client->dev, "enable",
                                              GPIOD_OUT_LOW);
        if (IS_ERR(mt9v111->oe)) {
-               dev_err(&client->dev, "Unable to get GPIO \"enable\": %ld\n",
-                       PTR_ERR(mt9v111->oe));
+               dev_err(&client->dev, "Unable to get GPIO \"enable\": %pe\n",
+                       mt9v111->oe);
                return PTR_ERR(mt9v111->oe);
        }
 
        mt9v111->standby = devm_gpiod_get_optional(&client->dev, "standby",
                                                   GPIOD_OUT_HIGH);
        if (IS_ERR(mt9v111->standby)) {
-               dev_err(&client->dev, "Unable to get GPIO \"standby\": %ld\n",
-                       PTR_ERR(mt9v111->standby));
+               dev_err(&client->dev, "Unable to get GPIO \"standby\": %pe\n",
+                       mt9v111->standby);
                return PTR_ERR(mt9v111->standby);
        }
 
        mt9v111->reset = devm_gpiod_get_optional(&client->dev, "reset",
                                                 GPIOD_OUT_LOW);
        if (IS_ERR(mt9v111->reset)) {
-               dev_err(&client->dev, "Unable to get GPIO \"reset\": %ld\n",
-                       PTR_ERR(mt9v111->reset));
+               dev_err(&client->dev, "Unable to get GPIO \"reset\": %pe\n",
+                       mt9v111->reset);
                return PTR_ERR(mt9v111->reset);
        }
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to