Skip to content

Commit eb25dcf

Browse files
Chen Nigregkh
authored andcommitted
usb: core: config: 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 657bfcb commit eb25dcf

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)