[media] uvcvideo: Simplify redundant check
authorOliver Neukum <oneukum@suse.de>
Thu, 23 Jan 2014 10:28:24 +0000 (07:28 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 28 Feb 2014 16:20:37 +0000 (13:20 -0300)
x < constant implies x + unsigned < constant
That check just obfuscates the code

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/uvc/uvc_driver.c

index c3bb2502225bc6c8932d4aca36de62f1fd1daee2..b6cac17c238eb8d1f71d1184d92cfb84a6945e42 100644 (file)
@@ -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);