[PATCH 16/32] media: i2c: ov5675: Use %pe format specifier
Bryan O'Donoghue
bryan.odonoghue at linaro.org
Tue Oct 14 14:10:27 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/ov5675.c:1188:9-16: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Ricardo Ribalda <ribalda at chromium.org>
> ---
> drivers/media/i2c/ov5675.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c
> index 30e27d39ee445c2603b8fecf7a1107969eb97df3..ea26df328189eef449ce121c0f62a4ef02631830 100644
> --- a/drivers/media/i2c/ov5675.c
> +++ b/drivers/media/i2c/ov5675.c
> @@ -1184,8 +1184,8 @@ static int ov5675_get_hwcfg(struct ov5675 *ov5675)
> ov5675->xvclk = devm_v4l2_sensor_clk_get(dev, NULL);
> if (IS_ERR(ov5675->xvclk))
> return dev_err_probe(dev, PTR_ERR(ov5675->xvclk),
> - "failed to get xvclk: %ld\n",
> - PTR_ERR(ov5675->xvclk));
> + "failed to get xvclk: %pe\n",
> + ov5675->xvclk);
>
> xvclk_rate = clk_get_rate(ov5675->xvclk);
> if (xvclk_rate != OV5675_XVCLK_19_2) {
>
> --
> 2.51.0.760.g7b8bcc2412-goog
>
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue at linaro.org>
More information about the Linux-rockchip
mailing list