Commit d38b24aa authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: ipu3-imgu: Use %u for formatting unsigned values (not %d)

The driver used %d for formatting unsigned values. Use %u instead.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarBingbu Cao <bingbu.cao@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 8ecc7c9d
...@@ -66,7 +66,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -66,7 +66,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable)
struct imgu_css_pipe *css_pipe = &imgu->css.pipes[pipe]; struct imgu_css_pipe *css_pipe = &imgu->css.pipes[pipe];
struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe]; struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];
dev_dbg(dev, "%s %d for pipe %d", __func__, enable, pipe); dev_dbg(dev, "%s %d for pipe %u", __func__, enable, pipe);
/* grab ctrl after streamon and return after off */ /* grab ctrl after streamon and return after off */
v4l2_ctrl_grab(imgu_sd->ctrl, enable); v4l2_ctrl_grab(imgu_sd->ctrl, enable);
...@@ -101,7 +101,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -101,7 +101,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable)
else else
css_pipe->pipe_id = IPU3_CSS_PIPE_ID_CAPTURE; css_pipe->pipe_id = IPU3_CSS_PIPE_ID_CAPTURE;
dev_dbg(dev, "IPU3 pipe %d pipe_id %d", pipe, css_pipe->pipe_id); dev_dbg(dev, "IPU3 pipe %u pipe_id %u", pipe, css_pipe->pipe_id);
rects[IPU3_CSS_RECT_EFFECTIVE] = &imgu_sd->rect.eff; rects[IPU3_CSS_RECT_EFFECTIVE] = &imgu_sd->rect.eff;
rects[IPU3_CSS_RECT_BDS] = &imgu_sd->rect.bds; rects[IPU3_CSS_RECT_BDS] = &imgu_sd->rect.bds;
...@@ -109,7 +109,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -109,7 +109,7 @@ static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable)
r = imgu_css_fmt_set(&imgu->css, fmts, rects, pipe); r = imgu_css_fmt_set(&imgu->css, fmts, rects, pipe);
if (r) { if (r) {
dev_err(dev, "failed to set initial formats pipe %d with (%d)", dev_err(dev, "failed to set initial formats pipe %u with (%d)",
pipe, r); pipe, r);
return r; return r;
} }
...@@ -157,7 +157,7 @@ static int imgu_subdev_set_fmt(struct v4l2_subdev *sd, ...@@ -157,7 +157,7 @@ static int imgu_subdev_set_fmt(struct v4l2_subdev *sd,
u32 pad = fmt->pad; u32 pad = fmt->pad;
unsigned int pipe = imgu_sd->pipe; unsigned int pipe = imgu_sd->pipe;
dev_dbg(&imgu->pci_dev->dev, "set subdev %d pad %d fmt to [%dx%d]", dev_dbg(&imgu->pci_dev->dev, "set subdev %u pad %u fmt to [%ux%u]",
pipe, pad, fmt->format.width, fmt->format.height); pipe, pad, fmt->format.width, fmt->format.height);
imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe = &imgu->imgu_pipe[pipe];
...@@ -233,7 +233,7 @@ static int imgu_subdev_set_selection(struct v4l2_subdev *sd, ...@@ -233,7 +233,7 @@ static int imgu_subdev_set_selection(struct v4l2_subdev *sd,
struct v4l2_rect *rect, *try_sel; struct v4l2_rect *rect, *try_sel;
dev_dbg(&imgu->pci_dev->dev, dev_dbg(&imgu->pci_dev->dev,
"set subdev %d sel which %d target 0x%4x rect [%dx%d]", "set subdev %u sel which %u target 0x%4x rect [%ux%u]",
imgu_sd->pipe, sel->which, sel->target, imgu_sd->pipe, sel->which, sel->target,
sel->r.width, sel->r.height); sel->r.width, sel->r.height);
...@@ -279,7 +279,7 @@ static int imgu_link_setup(struct media_entity *entity, ...@@ -279,7 +279,7 @@ static int imgu_link_setup(struct media_entity *entity,
WARN_ON(pad >= IMGU_NODE_NUM); WARN_ON(pad >= IMGU_NODE_NUM);
dev_dbg(&imgu->pci_dev->dev, "pipe %d pad %d is %s", pipe, pad, dev_dbg(&imgu->pci_dev->dev, "pipe %u pad %u is %s", pipe, pad,
flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled");
imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe = &imgu->imgu_pipe[pipe];
...@@ -294,7 +294,7 @@ static int imgu_link_setup(struct media_entity *entity, ...@@ -294,7 +294,7 @@ static int imgu_link_setup(struct media_entity *entity,
else else
__clear_bit(pipe, imgu->css.enabled_pipes); __clear_bit(pipe, imgu->css.enabled_pipes);
dev_dbg(&imgu->pci_dev->dev, "pipe %d is %s", pipe, dev_dbg(&imgu->pci_dev->dev, "pipe %u is %s", pipe,
flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled"); flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled");
return 0; return 0;
...@@ -370,7 +370,7 @@ static void imgu_vb2_buf_queue(struct vb2_buffer *vb) ...@@ -370,7 +370,7 @@ static void imgu_vb2_buf_queue(struct vb2_buffer *vb)
if (imgu->streaming) if (imgu->streaming)
imgu_queue_buffers(imgu, false, node->pipe); imgu_queue_buffers(imgu, false, node->pipe);
dev_dbg(&imgu->pci_dev->dev, "%s for pipe %d node %d", __func__, dev_dbg(&imgu->pci_dev->dev, "%s for pipe %u node %u", __func__,
node->pipe, node->id); node->pipe, node->id);
} }
...@@ -421,7 +421,7 @@ static bool imgu_all_nodes_streaming(struct imgu_device *imgu, ...@@ -421,7 +421,7 @@ static bool imgu_all_nodes_streaming(struct imgu_device *imgu,
pipe = except->pipe; pipe = except->pipe;
if (!test_bit(pipe, imgu->css.enabled_pipes)) { if (!test_bit(pipe, imgu->css.enabled_pipes)) {
dev_warn(&imgu->pci_dev->dev, dev_warn(&imgu->pci_dev->dev,
"pipe %d link is not ready yet", pipe); "pipe %u link is not ready yet", pipe);
return false; return false;
} }
...@@ -465,7 +465,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -465,7 +465,7 @@ static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
int r; int r;
unsigned int pipe; unsigned int pipe;
dev_dbg(dev, "%s node name %s pipe %d id %u", __func__, dev_dbg(dev, "%s node name %s pipe %u id %u", __func__,
node->name, node->pipe, node->id); node->name, node->pipe, node->id);
if (imgu->streaming) { if (imgu->streaming) {
...@@ -525,7 +525,7 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq) ...@@ -525,7 +525,7 @@ static void imgu_vb2_stop_streaming(struct vb2_queue *vq)
WARN_ON(!node->enabled); WARN_ON(!node->enabled);
pipe = node->pipe; pipe = node->pipe;
dev_dbg(dev, "Try to stream off node [%d][%d]", pipe, node->id); dev_dbg(dev, "Try to stream off node [%u][%u]", pipe, node->id);
imgu_pipe = &imgu->imgu_pipe[pipe]; imgu_pipe = &imgu->imgu_pipe[pipe];
r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0); r = v4l2_subdev_call(&imgu_pipe->imgu_sd.subdev, video, s_stream, 0);
if (r) if (r)
...@@ -659,10 +659,10 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int pipe, int node, ...@@ -659,10 +659,10 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int pipe, int node,
struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe]; struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];
struct imgu_v4l2_subdev *imgu_sd = &imgu_pipe->imgu_sd; struct imgu_v4l2_subdev *imgu_sd = &imgu_pipe->imgu_sd;
dev_dbg(dev, "set fmt node [%u][%u](try = %d)", pipe, node, try); dev_dbg(dev, "set fmt node [%u][%u](try = %u)", pipe, node, try);
for (i = 0; i < IMGU_NODE_NUM; i++) for (i = 0; i < IMGU_NODE_NUM; i++)
dev_dbg(dev, "IMGU pipe %d node %d enabled = %d", dev_dbg(dev, "IMGU pipe %u node %u enabled = %u",
pipe, i, imgu_pipe->nodes[i].enabled); pipe, i, imgu_pipe->nodes[i].enabled);
if (imgu_pipe->nodes[IMGU_NODE_VF].enabled) if (imgu_pipe->nodes[IMGU_NODE_VF].enabled)
...@@ -673,7 +673,7 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int pipe, int node, ...@@ -673,7 +673,7 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int pipe, int node,
else else
css_pipe->pipe_id = IPU3_CSS_PIPE_ID_CAPTURE; css_pipe->pipe_id = IPU3_CSS_PIPE_ID_CAPTURE;
dev_dbg(dev, "IPU3 pipe %d pipe_id = %d", pipe, css_pipe->pipe_id); dev_dbg(dev, "IPU3 pipe %u pipe_id = %u", pipe, css_pipe->pipe_id);
for (i = 0; i < IPU3_CSS_QUEUES; i++) { for (i = 0; i < IPU3_CSS_QUEUES; i++) {
unsigned int inode = imgu_map_node(imgu, i); unsigned int inode = imgu_map_node(imgu, i);
...@@ -777,7 +777,7 @@ static int imgu_vidioc_try_fmt(struct file *file, void *fh, ...@@ -777,7 +777,7 @@ static int imgu_vidioc_try_fmt(struct file *file, void *fh,
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp; struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
int r; int r;
dev_dbg(dev, "%s [%ux%u] for node %d\n", __func__, dev_dbg(dev, "%s [%ux%u] for node %u\n", __func__,
pix_mp->width, pix_mp->height, node->id); pix_mp->width, pix_mp->height, node->id);
r = imgu_try_fmt(file, fh, f); r = imgu_try_fmt(file, fh, f);
...@@ -795,7 +795,7 @@ static int imgu_vidioc_s_fmt(struct file *file, void *fh, struct v4l2_format *f) ...@@ -795,7 +795,7 @@ static int imgu_vidioc_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp; struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
int r; int r;
dev_dbg(dev, "%s [%ux%u] for node %d\n", __func__, dev_dbg(dev, "%s [%ux%u] for node %u\n", __func__,
pix_mp->width, pix_mp->height, node->id); pix_mp->width, pix_mp->height, node->id);
r = imgu_try_fmt(file, fh, f); r = imgu_try_fmt(file, fh, f);
...@@ -1018,7 +1018,7 @@ static int imgu_sd_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -1018,7 +1018,7 @@ static int imgu_sd_s_ctrl(struct v4l2_ctrl *ctrl)
struct imgu_device *imgu = v4l2_get_subdevdata(&imgu_sd->subdev); struct imgu_device *imgu = v4l2_get_subdevdata(&imgu_sd->subdev);
struct device *dev = &imgu->pci_dev->dev; struct device *dev = &imgu->pci_dev->dev;
dev_dbg(dev, "set val %d to ctrl 0x%8x for subdev %d", dev_dbg(dev, "set val %d to ctrl 0x%8x for subdev %u",
ctrl->val, ctrl->id, imgu_sd->pipe); ctrl->val, ctrl->id, imgu_sd->pipe);
switch (ctrl->id) { switch (ctrl->id) {
...@@ -1118,7 +1118,7 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu, ...@@ -1118,7 +1118,7 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu,
imgu_sd->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE | imgu_sd->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE |
V4L2_SUBDEV_FL_HAS_EVENTS; V4L2_SUBDEV_FL_HAS_EVENTS;
snprintf(imgu_sd->subdev.name, sizeof(imgu_sd->subdev.name), snprintf(imgu_sd->subdev.name, sizeof(imgu_sd->subdev.name),
"%s %d", IMGU_NAME, pipe); "%s %u", IMGU_NAME, pipe);
v4l2_set_subdevdata(&imgu_sd->subdev, imgu); v4l2_set_subdevdata(&imgu_sd->subdev, imgu);
atomic_set(&imgu_sd->running_mode, IPU3_RUNNING_MODE_VIDEO); atomic_set(&imgu_sd->running_mode, IPU3_RUNNING_MODE_VIDEO);
v4l2_ctrl_handler_init(hdl, 1); v4l2_ctrl_handler_init(hdl, 1);
...@@ -1236,7 +1236,7 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe, ...@@ -1236,7 +1236,7 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe,
} }
/* Initialize vdev */ /* Initialize vdev */
snprintf(vdev->name, sizeof(vdev->name), "%s %d %s", snprintf(vdev->name, sizeof(vdev->name), "%s %u %s",
IMGU_NAME, pipe, node->name); IMGU_NAME, pipe, node->name);
vdev->release = video_device_release_empty; vdev->release = video_device_release_empty;
vdev->fops = &imgu_v4l2_fops; vdev->fops = &imgu_v4l2_fops;
...@@ -1331,7 +1331,7 @@ static int imgu_v4l2_register_pipes(struct imgu_device *imgu) ...@@ -1331,7 +1331,7 @@ static int imgu_v4l2_register_pipes(struct imgu_device *imgu)
r = imgu_v4l2_subdev_register(imgu, &imgu_pipe->imgu_sd, i); r = imgu_v4l2_subdev_register(imgu, &imgu_pipe->imgu_sd, i);
if (r) { if (r) {
dev_err(&imgu->pci_dev->dev, dev_err(&imgu->pci_dev->dev,
"failed to register subdev%d ret (%d)\n", i, r); "failed to register subdev%u ret (%d)\n", i, r);
goto pipes_cleanup; goto pipes_cleanup;
} }
r = imgu_v4l2_nodes_setup_pipe(imgu, i); r = imgu_v4l2_nodes_setup_pipe(imgu, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment