Skip to content

Commit de95b8f

Browse files
author
Desnes Nunes
committed
usb: core: config: Use USB API functions rather than constants
JIRA: https://issues.redhat.com/browse/RHEL-116007 commit eb25dcf Author: Chen Ni <nichen@iscas.ac.cn> Date: Mon, 19 May 2025 14:13:17 +0800 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/20250519061317.724602-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent f756011 commit de95b8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
307307
goto skip_to_next_endpoint_or_interface_descriptor;
308308
}
309309

310-
i = d->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
310+
i = usb_endpoint_num(d);
311311
if (i == 0) {
312312
dev_notice(ddev, "config %d interface %d altsetting %d has an "
313313
"invalid descriptor for endpoint zero, skipping\n",

0 commit comments

Comments
 (0)