OSDN Git Service

media: usb: usbtv: remove duplicate & operation
authorJaejoong Kim <climbbb.kim@gmail.com>
Fri, 20 Oct 2017 07:25:28 +0000 (03:25 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Oct 2017 11:23:03 +0000 (07:23 -0400)
usb_endpoint_maxp() has an inline keyword and searches for bits[10:0]
by & operation with 0x7ff. So, we can remove the duplicate & operation
with 0x7ff.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/usbtv/usbtv-core.c

index f06f09a..b55b79b 100644 (file)
@@ -84,7 +84,7 @@ static int usbtv_probe(struct usb_interface *intf,
        /* Packet size is split into 11 bits of base size and count of
         * extra multiplies of it.*/
        size = usb_endpoint_maxp(&ep->desc);
-       size = (size & 0x07ff) * usb_endpoint_maxp_mult(&ep->desc);
+       size = size * usb_endpoint_maxp_mult(&ep->desc);
 
        /* Device structure */
        usbtv = kzalloc(sizeof(struct usbtv), GFP_KERNEL);