From: Chen Ni Date: Mon, 19 May 2025 06:25:44 +0000 (+0800) Subject: usb: gadget: epautoconf: Use USB API functions rather than constants X-Git-Tag: v6.16-rc1~28^2~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=ebaac1027a26ed62e0b6f24cd2d2cdf4a3ce73f2;p=linux-block.git usb: gadget: epautoconf: 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 Link: https://lore.kernel.org/r/20250519062545.724727-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index ed5a92c474e5..30016b805bfd 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -158,7 +158,7 @@ struct usb_ep *usb_ep_autoconfig( if (!ep) return NULL; - type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; + type = usb_endpoint_type(desc); /* report (variable) full speed bulk maxpacket */ if (type == USB_ENDPOINT_XFER_BULK) {