[PATCH 05/32] media: ar0521: Use %pe format specifier
Krzysztof Hałasa
khalasa at piap.pl
Mon Oct 13 21:24:43 PDT 2025
Ricardo Ribalda <ribalda at chromium.org> writes:
> 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/ar0521.c:1113:31-38: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Ricardo Ribalda <ribalda at chromium.org>
Thanks,
Acked-by: Krzysztof Hałasa <khalasa at piap.pl>
> --- a/drivers/media/i2c/ar0521.c
> +++ b/drivers/media/i2c/ar0521.c
> @@ -1109,8 +1109,8 @@ static int ar0521_probe(struct i2c_client *client)
> ar0521_supply_names[cnt]);
>
> if (IS_ERR(supply)) {
> - dev_info(dev, "no %s regulator found: %li\n",
> - ar0521_supply_names[cnt], PTR_ERR(supply));
> + dev_info(dev, "no %s regulator found: %pe\n",
> + ar0521_supply_names[cnt], supply);
> return PTR_ERR(supply);
> }
> sensor->supplies[cnt] = supply;
--
Krzysztof "Chris" Hałasa
Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa
More information about the Linux-mediatek
mailing list