diff mbox series

[v2,02/10] usb: isp1760: remove redundant max_packet() macro

Message ID 20220306075524.706660-3-mailhol.vincent@wanadoo.fr (mailing list archive)
State Superseded
Commit 61ef1709ee603b1d4677682c643986e817d5c6a4
Headers show
Series usb: rework usb_maxpacket() and remove its third argument | expand

Commit Message

Vincent Mailhol March 6, 2022, 7:55 a.m. UTC
The function usb_endpoint_maxp() (called by usb_maxpacket()) already
does the sanitazation of the USB endpoint max packet size. The call to
max_packet() does the same thing and is thus removed.

The macro max_packet() not being used anymore also gets removed.

CC: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/usb/isp1760/isp1760-hcd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Rui Miguel Silva March 6, 2022, 7:49 p.m. UTC | #1
Hi Vincent,
Thanks for the patch.

On Sun Mar 6, 2022 at 7:55 AM WET, Vincent Mailhol wrote:

> The function usb_endpoint_maxp() (called by usb_maxpacket()) already
> does the sanitazation of the USB endpoint max packet size. The call to
> max_packet() does the same thing and is thus removed.
>
> The macro max_packet() not being used anymore also gets removed.
>
> CC: Rui Miguel Silva <rui.silva@linaro.org>
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>

Thanks for the cleanup, looks good to me.

Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>

Cheers,
     Rui
> ---
>  drivers/usb/isp1760/isp1760-hcd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
> index 79d571f1429b..893becb077d3 100644
> --- a/drivers/usb/isp1760/isp1760-hcd.c
> +++ b/drivers/usb/isp1760/isp1760-hcd.c
> @@ -1768,7 +1768,6 @@ static void qtd_list_free(struct list_head *qtd_list)
>   * Packetize urb->transfer_buffer into list of packets of size wMaxPacketSize.
>   * Also calculate the PID type (SETUP/IN/OUT) for each packet.
>   */
> -#define max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)
>  static void packetize_urb(struct usb_hcd *hcd,
>  		struct urb *urb, struct list_head *head, gfp_t flags)
>  {
> @@ -1809,8 +1808,8 @@ static void packetize_urb(struct usb_hcd *hcd,
>  			packet_type = IN_PID;
>  	}
>  
> -	maxpacketsize = max_packet(usb_maxpacket(urb->dev, urb->pipe,
> -						usb_pipeout(urb->pipe)));
> +	maxpacketsize = usb_maxpacket(urb->dev, urb->pipe,
> +				      usb_pipeout(urb->pipe));
>  
>  	/*
>  	 * buffer gets wrapped in one or more qtds;
> -- 
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
index 79d571f1429b..893becb077d3 100644
--- a/drivers/usb/isp1760/isp1760-hcd.c
+++ b/drivers/usb/isp1760/isp1760-hcd.c
@@ -1768,7 +1768,6 @@  static void qtd_list_free(struct list_head *qtd_list)
  * Packetize urb->transfer_buffer into list of packets of size wMaxPacketSize.
  * Also calculate the PID type (SETUP/IN/OUT) for each packet.
  */
-#define max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)
 static void packetize_urb(struct usb_hcd *hcd,
 		struct urb *urb, struct list_head *head, gfp_t flags)
 {
@@ -1809,8 +1808,8 @@  static void packetize_urb(struct usb_hcd *hcd,
 			packet_type = IN_PID;
 	}
 
-	maxpacketsize = max_packet(usb_maxpacket(urb->dev, urb->pipe,
-						usb_pipeout(urb->pipe)));
+	maxpacketsize = usb_maxpacket(urb->dev, urb->pipe,
+				      usb_pipeout(urb->pipe));
 
 	/*
 	 * buffer gets wrapped in one or more qtds;