Commit 783e15dd authored by Chen Ni's avatar Chen Ni Committed by Greg Kroah-Hartman
Browse files

usb: gadget: dummy_hcd: Use USB API functions rather than constants



Use the function usb_endpoint_num() 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)

Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Link: https://lore.kernel.org/r/20250618065750.816965-1-nichen@iscas.ac.cn


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1857571e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -623,7 +623,7 @@ static int dummy_enable(struct usb_ep *_ep,

	dev_dbg(udc_dev(dum), "enabled %s (ep%d%s-%s) maxpacket %d stream %s\n",
		_ep->name,
		desc->bEndpointAddress & 0x0f,
		usb_endpoint_num(desc),
		(desc->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
		usb_ep_type_string(usb_endpoint_type(desc)),
		max, str_enabled_disabled(ep->stream_en));