mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: isely@isely.net
To: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	m.chehab@samsung.com, dcb314@hotmail.com
Subject: Re: [PATCH] media: pvrusb2: make logging code sane
Date: Thu, 10 Jul 2014 07:36:50 -0500 (CDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1407100735110.19815@ivanova.isely.net> (raw)
In-Reply-To: <1404995545-4286-1-git-send-email-andrey.krieger.utkin@gmail.com>


Nice.  I wonder if a previous merge mechanically resulted in this.  I 
can't imagine deliberately writing code like that.

  -Mike


Acked-by: Mike Isely <isely@pobox.com>

On Thu, 10 Jul 2014, Andrey Utkin wrote:

> The issue was discovered by static analysis. It turns out that code is
> somewhat insane, being
> if (x) {...} else { if (x) {...} }
> 
> Edited it to do the only reasonable thing, which is to log the
> information about the failed call. The most descriptive logging commands
> set is taken from original code.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79801
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index 7c280f3..1b158f1 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -951,15 +951,9 @@ static long pvr2_v4l2_ioctl(struct file *file,
>  	if (ret < 0) {
>  		if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
>  			pvr2_trace(PVR2_TRACE_V4LIOCTL,
> -				   "pvr2_v4l2_do_ioctl failure, ret=%ld", ret);
> -		} else {
> -			if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
> -				pvr2_trace(PVR2_TRACE_V4LIOCTL,
> -					   "pvr2_v4l2_do_ioctl failure, ret=%ld"
> -					   " command was:", ret);
> -				v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw),
> -						cmd);
> -			}
> +				   "pvr2_v4l2_do_ioctl failure, ret=%ld"
> +				   " command was:", ret);
> +			v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd);
>  		}
>  	} else {
>  		pvr2_trace(PVR2_TRACE_V4LIOCTL,
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

      reply	other threads:[~2014-07-10 12:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 12:32 Andrey Utkin
2014-07-10 12:36 ` isely [this message]

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=alpine.DEB.2.02.1407100735110.19815@ivanova.isely.net \
    --to=isely@isely.net \
    --cc=andrey.krieger.utkin@gmail.com \
    --cc=dcb314@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®