[PATCH 18/32] media: i2c: ov9282: Use %pe format specifier
Bryan O'Donoghue
bryan.odonoghue at linaro.org
Tue Oct 14 14:10:46 PDT 2025
On 13/10/2025 15:14, 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/ov9282.c:1133:3-10: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Ricardo Ribalda <ribalda at chromium.org>
> ---
> drivers/media/i2c/ov9282.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
> index a9f6176e9729d500a40004de92c35b9abf89b08c..3e24d88f603c1432865b4d880670e4b67f1b5cec 100644
> --- a/drivers/media/i2c/ov9282.c
> +++ b/drivers/media/i2c/ov9282.c
> @@ -1129,8 +1129,8 @@ static int ov9282_parse_hw_config(struct ov9282 *ov9282)
> ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset",
> GPIOD_OUT_LOW);
> if (IS_ERR(ov9282->reset_gpio)) {
> - dev_err(ov9282->dev, "failed to get reset gpio %ld",
> - PTR_ERR(ov9282->reset_gpio));
> + dev_err(ov9282->dev, "failed to get reset gpio %pe",
> + ov9282->reset_gpio);
> return PTR_ERR(ov9282->reset_gpio);
> }
>
>
> --
> 2.51.0.760.g7b8bcc2412-goog
>
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue at linaro.org>
More information about the Linux-mediatek
mailing list