]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: gadget: udc-xilinx: Use USB API functions rather than constants
authorChen Ni <nichen@iscas.ac.cn>
Wed, 18 Jun 2025 04:12:22 +0000 (12:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 10:24:03 +0000 (12:24 +0200)
commitfd2f928a5f7bc2f95887478c25b817f6e2215f3d
treec408d130c257d0679eb145ead3d2ed067ee651c1
parentb0ef41f1640e618aa37aa08ca4cd2a32e63b3dcb
usb: gadget: udc-xilinx: Use USB API functions rather than constants

Use the function usb_endpoint_num() and usb_endpoint_type()
rather than constants.

The Coccinelle semantic patch is as follows:

@@ struct usb_endpoint_descriptor *epd; @@

- (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\))
+ usb_endpoint_num(epd)

@@ 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>
Link: https://lore.kernel.org/r/20250618041222.408372-1-nichen@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/udc-xilinx.c