media: usb: remove duplicate & operation
Subsystems (2)
cover media: usb: remove duplicate & operation
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.
Jaejoong Kim (2):
media: usb: uvc: remove duplicate & operation
media: usb: usbtv: remove duplicate & operation
drivers/media/usb/usbtv/usbtv-core.c | 2 +- drivers/media/usb/uvc/uvc_video.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 media: usb: uvc: remove duplicate & operation
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.
--- drivers/media/usb/uvc/uvc_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/uvc/uvc_video.c +2 -2
@@ -1469,13 +1469,13 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev,case USB_SPEED_HIGH : psize =usb_endpoint_maxp (&ep->desc); mult =usb_endpoint_maxp_mult (&ep->desc); -return (psize &0x07ff ) * mult; +return psize * mult;case USB_SPEED_WIRELESS : psize =usb_endpoint_maxp (&ep->desc);return psize;default : psize =usb_endpoint_maxp (&ep->desc); -return psize &0x07ff ; +return psize; } }
Signature · 1 line
2.7.4
Re: [PATCH 1/2] media: usb: uvc: remove duplicate & operation
Hi, Laurent
Could you please review this patch?
Thanks, jaejoong
2017-10-20 16:25 GMT+09:00 Jaejoong Kim <[email protected]>:
Quoted 32 lines
usb_endpoint_maxp()has an inline keyword and searches for bits[10:0] by & operation with0x7ff. So, we can remove the duplicate & operation with0x7ff.Signed-off-by Jaejoong Kim <[email protected]>--- drivers/media/usb/uvc/uvc_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/usb/uvc/uvc_video.c +2
-3@@ -1469,13 +1469,13 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev,case USB_SPEED_HIGH : psize =usb_endpoint_maxp (&ep->desc); mult =usb_endpoint_maxp_mult (&ep->desc); -return (psize &0x07ff ) * mult; +return psize * mult;case USB_SPEED_WIRELESS : psize =usb_endpoint_maxp (&ep->desc);return psize;default : psize =usb_endpoint_maxp (&ep->desc); -return psize &0x07ff ; +return psize; } } --2.7.4
Re: [PATCH 1/2] media: usb: uvc: remove duplicate & operation
In reply to Jaejoong KimHello Jaejoong,
Thank you for the patch.
Quoted 5 lines · On Friday, 20 October 2017 10:25:27 EET Jaejoong Kim wrote:
usb_endpoint_maxp()has an inline keyword and searches for bits[10:0] by & operation with0x7ff. So, we can remove the duplicate & operation with0x7ff.Signed-off-by Jaejoong Kim <[email protected]>
and applied to my tree.
Quoted 23 lines
--- drivers/media/usb/uvc/uvc_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/media/usb/uvc/uvc_video.cindex fb86d6a..f4ace63 100644drivers/media/usb/uvc/uvc_video.c +0
-0@@ -1469,13 +1469,13 @@ static unsigned int uvc_endpoint_max_bpi(struct
usb_device*dev, caseUSB_SPEED_HIGH:drivers/media/usb/uvc/uvc_video.c +2
-2psize =usb_endpoint_maxp (&ep->desc); mult =usb_endpoint_maxp_mult (&ep->desc); -return (psize &0x07ff ) * mult; +return psize * mult;case USB_SPEED_WIRELESS : psize =usb_endpoint_maxp (&ep->desc);return psize;default : psize =usb_endpoint_maxp (&ep->desc); -return psize &0x07ff ; +return psize; } }
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 2/2 media: usb: usbtv: remove duplicate & operation
In reply to Jaejoong Kimusb_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.
--- drivers/media/usb/usbtv/usbtv-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/usbtv/usbtv-core.c +1 -1
@@ -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 );
Signature · 1 line
2.7.4