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:
./ipu7/ipu7-isys-csi-phy.c:311:23-30: WARNING: Consider using %pe to print PTR_ERR()
./ipu7/ipu7-isys-csi2.c:59:22-29: 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>
pad = media_entity_remote_source_pad_unique(&csi2->asd.sd.entity);
if (IS_ERR(pad)) {
- dev_warn(dev, "can't get remote source pad of %s (%ld)\n",
- csi2->asd.sd.name, PTR_ERR(pad));
+ dev_warn(dev, "can't get remote source pad of %s (%pe)\n",
+ csi2->asd.sd.name, pad);
return PTR_ERR(pad);
}
src_pad = media_entity_remote_source_pad_unique(&csi2->asd.sd.entity);
if (IS_ERR(src_pad)) {
dev_err(&csi2->isys->adev->auxdev.dev,
- "can't get source pad of %s (%ld)\n",
- csi2->asd.sd.name, PTR_ERR(src_pad));
+ "can't get source pad of %s (%pe)\n",
+ csi2->asd.sd.name, src_pad);
return PTR_ERR(src_pad);
}