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:
./platform/nxp/imx8mq-mipi-csi2.c:422:23-30: WARNING: Consider using %pe to print PTR_ERR()
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Martin Kepplinger-Novakovic <martink@posteo.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
src_pad = media_entity_remote_source_pad_unique(&sd_state->sd->entity);
if (IS_ERR(src_pad)) {
- dev_err(state->dev, "can't get source pad of %s (%ld)\n",
- sd_state->sd->name, PTR_ERR(src_pad));
+ dev_err(state->dev, "can't get source pad of %s (%pe)\n",
+ sd_state->sd->name, src_pad);
return PTR_ERR(src_pad);
}