Commit d33fbcbb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (12168): v4l2-ioctl: avoid flooding log with unasked debug messages

Thanks to Hans Verkuil <hverkuil@xs4all.nl> for pointing this issue on
my last patch.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d1afe425
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\
} while (0) } while (0)
#define dbgarg3(fmt, arg...) \
do { \
if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \
printk(KERN_CONT "%s: " fmt, vfd->name, ## arg);\
} while (0)
/* Zero out the end of the struct pointed to by p. Everthing after, but /* Zero out the end of the struct pointed to by p. Everthing after, but
* not including, the specified field is cleared. */ * not including, the specified field is cleared. */
#define CLEAR_AFTER_FIELD(p, field) \ #define CLEAR_AFTER_FIELD(p, field) \
...@@ -1735,20 +1741,20 @@ static long __video_do_ioctl(struct file *file, ...@@ -1735,20 +1741,20 @@ static long __video_do_ioctl(struct file *file,
p->type); p->type);
switch (p->type) { switch (p->type) {
case V4L2_FRMSIZE_TYPE_DISCRETE: case V4L2_FRMSIZE_TYPE_DISCRETE:
printk("width = %d, height=%d\n", dbgarg3("width = %d, height=%d\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:
printk("min %dx%d, max %dx%d, step %dx%d\n", dbgarg3("min %dx%d, max %dx%d, step %dx%d\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);
break; break;
case V4L2_FRMSIZE_TYPE_CONTINUOUS: case V4L2_FRMSIZE_TYPE_CONTINUOUS:
printk("continuous\n"); dbgarg3("continuous\n");
break; break;
default: default:
printk("- Unknown type!\n"); dbgarg3("- Unknown type!\n");
} }
break; break;
......
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