linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Chen Ni <nichen@iscas.ac.cn>,
	Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc2: gadget: Use USB API functions rather than constants
Date: Tue, 3 Jun 2025 07:18:07 +0000	[thread overview]
Message-ID: <fcf9ac38-e2be-4fb9-f91e-c4ff358aa6a6@synopsys.com> (raw)
In-Reply-To: <20250519062229.724664-1-nichen@iscas.ac.cn>



On 5/19/25 10:22, Chen Ni wrote:
> Use the function usb_endpoint_type() rather than constants.
> The Coccinelle semantic patch is as follows:
> 
> @@ struct usb_endpoint_descriptor *epd; @@
> 
> - (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
> + usb_endpoint_type(epd)
> 
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Acked-by: Minas Harutyunyan <hminas@synopsys.com>

> ---
>   drivers/usb/dwc2/gadget.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index f323fb5597b3..d5b622f78cf3 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -4049,7 +4049,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
>   		return -EINVAL;
>   	}
>   
> -	ep_type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
> +	ep_type = usb_endpoint_type(desc);
>   	mps = usb_endpoint_maxp(desc);
>   	mc = usb_endpoint_maxp_mult(desc);
>   

      reply	other threads:[~2025-06-03  7:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19  6:22 [PATCH] usb: dwc2: gadget: Use USB API functions rather than constants Chen Ni
2025-06-03  7:18 ` Minas Harutyunyan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcf9ac38-e2be-4fb9-f91e-c4ff358aa6a6@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nichen@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).