All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	Scott Jiang <scott.jiang.linux@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Andy Walls <awalls@md.metrocast.net>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Tomasz Stanislawski <t.stanislaws@samsung.com>,
	Alexey Klimov <klimov.linux@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Brian Johnson <brijohn@gmail.com>, Mike Isely <isely@pobox.com>,
	Ezequiel Garcia <elezegarcia@gmail.com>,
	Huang Shijie <shijie8@gmail.com>,
	Ismael Luceno <ismael.luceno@corp.bluecherry.net>,
	Takashi Iwai <tiwai@suse.de>,
	Ondrej Zary <linux@rainbow-software.org>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [REVIEWv2 PATCH 5/6] v4l2-ioctl: simplify debug code.
Date: Sun, 24 Mar 2013 07:12:42 -0300	[thread overview]
Message-ID: <20130324071242.5129d395@redhat.com> (raw)
In-Reply-To: <1363615925-19507-6-git-send-email-hverkuil@xs4all.nl>

Em Mon, 18 Mar 2013 15:12:04 +0100
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> The core debug code can now be simplified since all the write-only ioctls are
> now const and will not modify the data they pass to the drivers.
> 
> So instead of logging write-only ioctls before the driver is called this can
> now be done afterwards, which is cleaner when it comes to error reporting as
> well.
> 
> This also fixes a logic error in the debugging code where there was one 'else'
> too many.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Patch looks ok, but I won't apply right now, as it seems it depends on 4/6.

Regards,
Mauro

> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c |   15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 2abd13a..b3fe148 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -2147,11 +2147,6 @@ static long __video_do_ioctl(struct file *file,
>  	}
>  
>  	write_only = _IOC_DIR(cmd) == _IOC_WRITE;
> -	if (write_only && debug > V4L2_DEBUG_IOCTL) {
> -		v4l_printk_ioctl(video_device_node_name(vfd), cmd);
> -		pr_cont(": ");
> -		info->debug(arg, write_only);
> -	}
>  	if (info->flags & INFO_FL_STD) {
>  		typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
>  		const void *p = vfd->ioctl_ops;
> @@ -2170,16 +2165,10 @@ static long __video_do_ioctl(struct file *file,
>  
>  done:
>  	if (debug) {
> -		if (write_only && debug > V4L2_DEBUG_IOCTL) {
> -			if (ret < 0)
> -				printk(KERN_DEBUG "%s: error %ld\n",
> -					video_device_node_name(vfd), ret);
> -			return ret;
> -		}
>  		v4l_printk_ioctl(video_device_node_name(vfd), cmd);
>  		if (ret < 0)
> -			pr_cont(": error %ld\n", ret);
> -		else if (debug == V4L2_DEBUG_IOCTL)
> +			pr_cont(": error %ld", ret);
> +		if (debug == V4L2_DEBUG_IOCTL)
>  			pr_cont("\n");
>  		else if (_IOC_DIR(cmd) == _IOC_NONE)
>  			info->debug(arg, write_only);


-- 

Cheers,
Mauro

  reply	other threads:[~2013-03-24 10:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 14:11 [REVIEWv2 PATCH 0/6] v4l2: constify _IOW ioctls Hans Verkuil
2013-03-18 14:12 ` [REVIEWv2 PATCH 1/6] v4l2: add const to argument of write-only s_frequency ioctl Hans Verkuil
2013-03-18 23:17   ` Laurent Pinchart
2013-03-19  7:12     ` Hans Verkuil
2013-03-18 14:12 ` [REVIEWv2 PATCH 2/6] v4l2: add const to argument of write-only s_tuner ioctl Hans Verkuil
2013-03-18 14:12 ` [REVIEWv2 PATCH 3/6] v4l2: pass std by value to the write-only s_std ioctl Hans Verkuil
2013-03-18 14:12 ` [REVIEWv2 PATCH 4/6] v4l2: add const to argument of write-only s_register ioctl Hans Verkuil
2013-03-18 23:20   ` Laurent Pinchart
2013-03-19  7:07     ` Hans Verkuil
2013-03-24 10:07   ` Mauro Carvalho Chehab
2013-03-24 10:12     ` Hans Verkuil
2013-03-18 14:12 ` [REVIEWv2 PATCH 5/6] v4l2-ioctl: simplify debug code Hans Verkuil
2013-03-24 10:12   ` Mauro Carvalho Chehab [this message]
2013-03-18 14:12 ` [REVIEWv2 PATCH 6/6] v4l2-ioctl: add precision when printing names Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130324071242.5129d395@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=brijohn@gmail.com \
    --cc=corbet@lwn.net \
    --cc=elezegarcia@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@pobox.com \
    --cc=ismael.luceno@corp.bluecherry.net \
    --cc=klimov.linux@gmail.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=scott.jiang.linux@gmail.com \
    --cc=shijie8@gmail.com \
    --cc=t.stanislaws@samsung.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.