All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: oliver@neukum.org
Cc: linux-media@vger.kernel.org, Oliver Neukum <oneukum@suse.de>
Subject: Re: [PATCH] uvc: simplify redundant check
Date: Thu, 23 Jan 2014 12:32:47 +0100	[thread overview]
Message-ID: <4763775.AWFediJpdO@avalon> (raw)
In-Reply-To: <1390472905-29586-1-git-send-email-oliver@neukum.org>

Hi Oliver,

Thank you for the patch.

On Thursday 23 January 2014 11:28:24 oliver@neukum.org wrote:
> From: Oliver Neukum <oneukum@suse.de>
> 
> x < constant implies x + unsigned < constant
> That check just obfuscates the code
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.de>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I've applied the patch to my tree and will send a pull request for v3.15.

> ---
>  drivers/media/usb/uvc/uvc_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c index c3bb250..b6cac17 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -925,7 +925,7 @@ static int uvc_parse_standard_control(struct uvc_device
> *dev, case UVC_VC_HEADER:
>  		n = buflen >= 12 ? buffer[11] : 0;
> 
> -		if (buflen < 12 || buflen < 12 + n) {
> +		if (buflen < 12 + n) {
>  			uvc_trace(UVC_TRACE_DESCR, "device %d videocontrol "
>  				"interface %d HEADER error\n", udev->devnum,
>  				alts->desc.bInterfaceNumber);

-- 
Regards,

Laurent Pinchart


      parent reply	other threads:[~2014-01-23 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 10:28 [PATCH] uvc: simplify redundant check oliver
2014-01-23 10:28 ` oliver
2014-01-23 11:32 ` Laurent Pinchart [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=4763775.AWFediJpdO@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=oneukum@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.