From: Oliver Neukum Date: Thu, 23 Jan 2014 10:28:24 +0000 (-0300) Subject: [media] uvcvideo: Simplify redundant check X-Git-Tag: v3.15-rc1~85^2~347 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=daf41ac2c4b5b2e663079ccc58b8d6a70a3c111b;p=karo-tx-linux.git [media] uvcvideo: Simplify redundant check x < constant implies x + unsigned < constant That check just obfuscates the code Signed-off-by: Oliver Neukum Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index c3bb2502225b..b6cac17c238e 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);