Commit 560dde24 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l2-ioctl: don't print the clips list

The clips pointer is a userspace pointer, not a kernelspace pointer,
so you can't dereference the clips pointer.
Also add a few missing commas and newlines.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3963d4fb
...@@ -243,7 +243,6 @@ static void v4l_print_format(const void *arg, bool write_only) ...@@ -243,7 +243,6 @@ static void v4l_print_format(const void *arg, bool write_only)
const struct v4l2_vbi_format *vbi; const struct v4l2_vbi_format *vbi;
const struct v4l2_sliced_vbi_format *sliced; const struct v4l2_sliced_vbi_format *sliced;
const struct v4l2_window *win; const struct v4l2_window *win;
const struct v4l2_clip *clip;
unsigned i; unsigned i;
pr_cont("type=%s", prt_names(p->type, v4l2_type_names)); pr_cont("type=%s", prt_names(p->type, v4l2_type_names));
...@@ -253,7 +252,7 @@ static void v4l_print_format(const void *arg, bool write_only) ...@@ -253,7 +252,7 @@ static void v4l_print_format(const void *arg, bool write_only)
pix = &p->fmt.pix; pix = &p->fmt.pix;
pr_cont(", width=%u, height=%u, " pr_cont(", width=%u, height=%u, "
"pixelformat=%c%c%c%c, field=%s, " "pixelformat=%c%c%c%c, field=%s, "
"bytesperline=%u sizeimage=%u, colorspace=%d\n", "bytesperline=%u, sizeimage=%u, colorspace=%d\n",
pix->width, pix->height, pix->width, pix->height,
(pix->pixelformat & 0xff), (pix->pixelformat & 0xff),
(pix->pixelformat >> 8) & 0xff, (pix->pixelformat >> 8) & 0xff,
...@@ -284,20 +283,14 @@ static void v4l_print_format(const void *arg, bool write_only) ...@@ -284,20 +283,14 @@ static void v4l_print_format(const void *arg, bool write_only)
case V4L2_BUF_TYPE_VIDEO_OVERLAY: case V4L2_BUF_TYPE_VIDEO_OVERLAY:
case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
win = &p->fmt.win; win = &p->fmt.win;
pr_cont(", wxh=%dx%d, x,y=%d,%d, field=%s, " /* Note: we can't print the clip list here since the clips
"chromakey=0x%08x, bitmap=%p, " * pointer is a userspace pointer, not a kernelspace
"global_alpha=0x%02x\n", * pointer. */
win->w.width, win->w.height, pr_cont(", wxh=%dx%d, x,y=%d,%d, field=%s, chromakey=0x%08x, clipcount=%u, clips=%p, bitmap=%p, global_alpha=0x%02x\n",
win->w.left, win->w.top, win->w.width, win->w.height, win->w.left, win->w.top,
prt_names(win->field, v4l2_field_names), prt_names(win->field, v4l2_field_names),
win->chromakey, win->bitmap, win->global_alpha); win->chromakey, win->clipcount, win->clips,
clip = win->clips; win->bitmap, win->global_alpha);
for (i = 0; i < win->clipcount; i++) {
printk(KERN_DEBUG "clip %u: wxh=%dx%d, x,y=%d,%d\n",
i, clip->c.width, clip->c.height,
clip->c.left, clip->c.top);
clip = clip->next;
}
break; break;
case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_CAPTURE:
case V4L2_BUF_TYPE_VBI_OUTPUT: case V4L2_BUF_TYPE_VBI_OUTPUT:
...@@ -332,7 +325,7 @@ static void v4l_print_framebuffer(const void *arg, bool write_only) ...@@ -332,7 +325,7 @@ static void v4l_print_framebuffer(const void *arg, bool write_only)
pr_cont("capability=0x%x, flags=0x%x, base=0x%p, width=%u, " pr_cont("capability=0x%x, flags=0x%x, base=0x%p, width=%u, "
"height=%u, pixelformat=%c%c%c%c, " "height=%u, pixelformat=%c%c%c%c, "
"bytesperline=%u sizeimage=%u, colorspace=%d\n", "bytesperline=%u, sizeimage=%u, colorspace=%d\n",
p->capability, p->flags, p->base, p->capability, p->flags, p->base,
p->fmt.width, p->fmt.height, p->fmt.width, p->fmt.height,
(p->fmt.pixelformat & 0xff), (p->fmt.pixelformat & 0xff),
...@@ -353,7 +346,7 @@ static void v4l_print_modulator(const void *arg, bool write_only) ...@@ -353,7 +346,7 @@ static void v4l_print_modulator(const void *arg, bool write_only)
const struct v4l2_modulator *p = arg; const struct v4l2_modulator *p = arg;
if (write_only) if (write_only)
pr_cont("index=%u, txsubchans=0x%x", p->index, p->txsubchans); pr_cont("index=%u, txsubchans=0x%x\n", p->index, p->txsubchans);
else else
pr_cont("index=%u, name=%.*s, capability=0x%x, " pr_cont("index=%u, name=%.*s, capability=0x%x, "
"rangelow=%u, rangehigh=%u, txsubchans=0x%x\n", "rangelow=%u, rangehigh=%u, txsubchans=0x%x\n",
...@@ -445,13 +438,13 @@ static void v4l_print_buffer(const void *arg, bool write_only) ...@@ -445,13 +438,13 @@ static void v4l_print_buffer(const void *arg, bool write_only)
for (i = 0; i < p->length; ++i) { for (i = 0; i < p->length; ++i) {
plane = &p->m.planes[i]; plane = &p->m.planes[i];
printk(KERN_DEBUG printk(KERN_DEBUG
"plane %d: bytesused=%d, data_offset=0x%08x " "plane %d: bytesused=%d, data_offset=0x%08x, "
"offset/userptr=0x%lx, length=%d\n", "offset/userptr=0x%lx, length=%d\n",
i, plane->bytesused, plane->data_offset, i, plane->bytesused, plane->data_offset,
plane->m.userptr, plane->length); plane->m.userptr, plane->length);
} }
} else { } else {
pr_cont("bytesused=%d, offset/userptr=0x%lx, length=%d\n", pr_cont(", bytesused=%d, offset/userptr=0x%lx, length=%d\n",
p->bytesused, p->m.userptr, p->length); p->bytesused, p->m.userptr, p->length);
} }
...@@ -504,6 +497,8 @@ static void v4l_print_streamparm(const void *arg, bool write_only) ...@@ -504,6 +497,8 @@ static void v4l_print_streamparm(const void *arg, bool write_only)
c->capability, c->outputmode, c->capability, c->outputmode,
c->timeperframe.numerator, c->timeperframe.denominator, c->timeperframe.numerator, c->timeperframe.denominator,
c->extendedmode, c->writebuffers); c->extendedmode, c->writebuffers);
} else {
pr_cont("\n");
} }
} }
...@@ -734,11 +729,11 @@ static void v4l_print_frmsizeenum(const void *arg, bool write_only) ...@@ -734,11 +729,11 @@ static void v4l_print_frmsizeenum(const void *arg, bool write_only)
p->type); p->type);
switch (p->type) { switch (p->type) {
case V4L2_FRMSIZE_TYPE_DISCRETE: case V4L2_FRMSIZE_TYPE_DISCRETE:
pr_cont(" wxh=%ux%u\n", pr_cont(", wxh=%ux%u\n",
p->discrete.width, p->discrete.height); p->discrete.width, p->discrete.height);
break; break;
case V4L2_FRMSIZE_TYPE_STEPWISE: case V4L2_FRMSIZE_TYPE_STEPWISE:
pr_cont(" min=%ux%u, max=%ux%u, step=%ux%u\n", pr_cont(", min=%ux%u, max=%ux%u, step=%ux%u\n",
p->stepwise.min_width, p->stepwise.min_height, p->stepwise.min_width, p->stepwise.min_height,
p->stepwise.step_width, p->stepwise.step_height, p->stepwise.step_width, p->stepwise.step_height,
p->stepwise.max_width, p->stepwise.max_height); p->stepwise.max_width, p->stepwise.max_height);
...@@ -764,12 +759,12 @@ static void v4l_print_frmivalenum(const void *arg, bool write_only) ...@@ -764,12 +759,12 @@ static void v4l_print_frmivalenum(const void *arg, bool write_only)
p->width, p->height, p->type); p->width, p->height, p->type);
switch (p->type) { switch (p->type) {
case V4L2_FRMIVAL_TYPE_DISCRETE: case V4L2_FRMIVAL_TYPE_DISCRETE:
pr_cont(" fps=%d/%d\n", pr_cont(", fps=%d/%d\n",
p->discrete.numerator, p->discrete.numerator,
p->discrete.denominator); p->discrete.denominator);
break; break;
case V4L2_FRMIVAL_TYPE_STEPWISE: case V4L2_FRMIVAL_TYPE_STEPWISE:
pr_cont(" min=%d/%d, max=%d/%d, step=%d/%d\n", pr_cont(", min=%d/%d, max=%d/%d, step=%d/%d\n",
p->stepwise.min.numerator, p->stepwise.min.numerator,
p->stepwise.min.denominator, p->stepwise.min.denominator,
p->stepwise.max.numerator, p->stepwise.max.numerator,
...@@ -807,8 +802,8 @@ static void v4l_print_event(const void *arg, bool write_only) ...@@ -807,8 +802,8 @@ static void v4l_print_event(const void *arg, bool write_only)
pr_cont("value64=%lld, ", c->value64); pr_cont("value64=%lld, ", c->value64);
else else
pr_cont("value=%d, ", c->value); pr_cont("value=%d, ", c->value);
pr_cont("flags=0x%x, minimum=%d, maximum=%d, step=%d," pr_cont("flags=0x%x, minimum=%d, maximum=%d, step=%d, "
" default_value=%d\n", "default_value=%d\n",
c->flags, c->minimum, c->maximum, c->flags, c->minimum, c->maximum,
c->step, c->default_value); c->step, c->default_value);
break; break;
...@@ -845,7 +840,7 @@ static void v4l_print_freq_band(const void *arg, bool write_only) ...@@ -845,7 +840,7 @@ static void v4l_print_freq_band(const void *arg, bool write_only)
const struct v4l2_frequency_band *p = arg; const struct v4l2_frequency_band *p = arg;
pr_cont("tuner=%u, type=%u, index=%u, capability=0x%x, " pr_cont("tuner=%u, type=%u, index=%u, capability=0x%x, "
"rangelow=%u, rangehigh=%u, modulation=0x%x\n", "rangelow=%u, rangehigh=%u, modulation=0x%x\n",
p->tuner, p->type, p->index, p->tuner, p->type, p->index,
p->capability, p->rangelow, p->capability, p->rangelow,
p->rangehigh, p->modulation); p->rangehigh, p->modulation);
......
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