public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] media: usb: remove duplicate & operation
@ 2017-10-20  7:25 Jaejoong Kim
  2017-10-20  7:25 ` [PATCH 1/2] media: usb: uvc: " Jaejoong Kim
  2017-10-20  7:25 ` [PATCH 2/2] media: usb: usbtv: " Jaejoong Kim
  0 siblings, 2 replies; 5+ messages in thread
From: Jaejoong Kim @ 2017-10-20  7:25 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, Jaejoong Kim

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] media: usb: uvc: remove duplicate & operation
  2017-10-20  7:25 [PATCH 0/2] media: usb: remove duplicate & operation Jaejoong Kim
@ 2017-10-20  7:25 ` Jaejoong Kim
  2017-11-06  2:07   ` Jaejoong Kim
  2017-11-07 11:36   ` Laurent Pinchart
  2017-10-20  7:25 ` [PATCH 2/2] media: usb: usbtv: " Jaejoong Kim
  1 sibling, 2 replies; 5+ messages in thread
From: Jaejoong Kim @ 2017-10-20  7:25 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, Jaejoong Kim

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>
---
 drivers/media/usb/uvc/uvc_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index fb86d6a..f4ace63 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] media: usb: usbtv: remove duplicate & operation
  2017-10-20  7:25 [PATCH 0/2] media: usb: remove duplicate & operation Jaejoong Kim
  2017-10-20  7:25 ` [PATCH 1/2] media: usb: uvc: " Jaejoong Kim
@ 2017-10-20  7:25 ` Jaejoong Kim
  1 sibling, 0 replies; 5+ messages in thread
From: Jaejoong Kim @ 2017-10-20  7:25 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, Jaejoong Kim

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>
---
 drivers/media/usb/usbtv/usbtv-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
index ceb953b..a95a468 100644
--- a/drivers/media/usb/usbtv/usbtv-core.c
+++ b/drivers/media/usb/usbtv/usbtv-core.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] media: usb: uvc: remove duplicate & operation
  2017-10-20  7:25 ` [PATCH 1/2] media: usb: uvc: " Jaejoong Kim
@ 2017-11-06  2:07   ` Jaejoong Kim
  2017-11-07 11:36   ` Laurent Pinchart
  1 sibling, 0 replies; 5+ messages in thread
From: Jaejoong Kim @ 2017-11-06  2:07 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, Jaejoong Kim

Hi, Laurent

Could you please review this patch?

Thanks, jaejoong

2017-10-20 16:25 GMT+09:00 Jaejoong Kim <climbbb.kim@gmail.com>:
> 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>
> ---
>  drivers/media/usb/uvc/uvc_video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index fb86d6a..f4ace63 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] media: usb: uvc: remove duplicate & operation
  2017-10-20  7:25 ` [PATCH 1/2] media: usb: uvc: " Jaejoong Kim
  2017-11-06  2:07   ` Jaejoong Kim
@ 2017-11-07 11:36   ` Laurent Pinchart
  1 sibling, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2017-11-07 11:36 UTC (permalink / raw)
  To: Jaejoong Kim; +Cc: Mauro Carvalho Chehab, linux-media

Hello Jaejoong,

Thank you for the patch.

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 with 0x7ff. So, we can remove the duplicate & operation
> with 0x7ff.
> 
> Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>

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

and applied to my tree.

> ---
>  drivers/media/usb/uvc/uvc_video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_video.c
> b/drivers/media/usb/uvc/uvc_video.c index fb86d6a..f4ace63 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -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;
>  	}
>  }


-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-07 11:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20  7:25 [PATCH 0/2] media: usb: remove duplicate & operation Jaejoong Kim
2017-10-20  7:25 ` [PATCH 1/2] media: usb: uvc: " Jaejoong Kim
2017-11-06  2:07   ` Jaejoong Kim
2017-11-07 11:36   ` Laurent Pinchart
2017-10-20  7:25 ` [PATCH 2/2] media: usb: usbtv: " Jaejoong Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox