Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: ov9282: Use %pe format specifier

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@chromium.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
b3c30874 ca1c388a

+2 -2
+2 -2
drivers/media/i2c/ov9282.c
··· 1129 1129 ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset", 1130 1130 GPIOD_OUT_LOW); 1131 1131 if (IS_ERR(ov9282->reset_gpio)) { 1132 - dev_err(ov9282->dev, "failed to get reset gpio %ld", 1133 - PTR_ERR(ov9282->reset_gpio)); 1132 + dev_err(ov9282->dev, "failed to get reset gpio %pe", 1133 + ov9282->reset_gpio); 1134 1134 return PTR_ERR(ov9282->reset_gpio); 1135 1135 } 1136 1136