diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-02 17:07:32 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-02 17:07:32 -0300 |
commit | 7f7e5771a2066c2e13c278643b4fe12c4a3e228f (patch) | |
tree | 58f10bb8d4bf52bc1ca95e4b1ddf583185a5b40b /linux/drivers | |
parent | 3a81029396ea0bf8d3815ad1337b6d99a8b18240 (diff) | |
download | mediapointer-dvb-s2-7f7e5771a2066c2e13c278643b4fe12c4a3e228f.tar.gz mediapointer-dvb-s2-7f7e5771a2066c2e13c278643b4fe12c4a3e228f.tar.bz2 |
v4l2-ioctl: avoid flooding log with unasked debug messages
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Thanks to Hans Verkuil <hverkuil@xs4all.nl> for pointing this issue on
my last patch.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/v4l2-ioctl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/linux/drivers/media/video/v4l2-ioctl.c b/linux/drivers/media/video/v4l2-ioctl.c index 625fe7698..80c94dc5a 100644 --- a/linux/drivers/media/video/v4l2-ioctl.c +++ b/linux/drivers/media/video/v4l2-ioctl.c @@ -43,6 +43,12 @@ printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ } 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 * not including, the specified field is cleared. */ #define CLEAR_AFTER_FIELD(p, field) \ @@ -1727,20 +1733,20 @@ static long __video_do_ioctl(struct file *file, p->type); switch (p->type) { case V4L2_FRMSIZE_TYPE_DISCRETE: - printk("width = %d, height=%d\n", + dbgarg3("width = %d, height=%d\n", p->discrete.width, p->discrete.height); break; 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.step_width, p->stepwise.step_height, p->stepwise.max_width, p->stepwise.max_height); break; case V4L2_FRMSIZE_TYPE_CONTINUOUS: - printk("continuous\n"); + dbgarg3("continuous\n"); break; default: - printk("- Unknown type!\n"); + dbgarg3("- Unknown type!\n"); } break; |