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

media: i2c: mt9m111: 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/mt9m111.c:1290:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.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
e027f53e e8fd8080

+2 -2
+2 -2
drivers/media/i2c/mt9m111.c
··· 1286 1286 1287 1287 mt9m111->regulator = devm_regulator_get(&client->dev, "vdd"); 1288 1288 if (IS_ERR(mt9m111->regulator)) { 1289 - dev_err(&client->dev, "regulator not found: %ld\n", 1290 - PTR_ERR(mt9m111->regulator)); 1289 + dev_err(&client->dev, "regulator not found: %pe\n", 1290 + mt9m111->regulator); 1291 1291 return PTR_ERR(mt9m111->regulator); 1292 1292 } 1293 1293