mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 01:49:20 -04:00
usb: gadget: composite: 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: Chen Ni <nichen@iscas.ac.cn> Link: https://lore.kernel.org/r/20250618035540.290411-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
100a9aa232
commit
24214604d2
@@ -1011,7 +1011,7 @@ static int set_config(struct usb_composite_dev *cdev,
|
||||
|
||||
ep = (struct usb_endpoint_descriptor *)*descriptors;
|
||||
addr = ((ep->bEndpointAddress & 0x80) >> 3)
|
||||
| (ep->bEndpointAddress & 0x0f);
|
||||
| usb_endpoint_num(ep);
|
||||
set_bit(addr, f->endpoints);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user