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

media: ar0521: 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/ar0521.c:1113:31-38: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
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
435becbe ce5bf59e

+2 -2
+2 -2
drivers/media/i2c/ar0521.c
··· 1109 1109 ar0521_supply_names[cnt]); 1110 1110 1111 1111 if (IS_ERR(supply)) { 1112 - dev_info(dev, "no %s regulator found: %li\n", 1113 - ar0521_supply_names[cnt], PTR_ERR(supply)); 1112 + dev_info(dev, "no %s regulator found: %pe\n", 1113 + ar0521_supply_names[cnt], supply); 1114 1114 return PTR_ERR(supply); 1115 1115 } 1116 1116 sensor->supplies[cnt] = supply;