[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250519062229.724664-1-nichen@iscas.ac.cn>
Date: Mon, 19 May 2025 14:22:29 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: hminas@...opsys.com,
gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] usb: dwc2: gadget: Use USB API functions rather than constants
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@...as.ac.cn>
---
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);
--
2.25.1
Powered by blists - more mailing lists