usb: gadget: f_fs: 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/20250618070216.817034-1-nichen@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chen Ni 2025-06-18 15:02:16 +08:00 committed by Greg Kroah-Hartman
parent a4e668fd49
commit b0ef41f164
1 changed files with 1 additions and 1 deletions

View File

@ -3295,7 +3295,7 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep,
if (ffs_ep->descs[ep_desc_id]) { if (ffs_ep->descs[ep_desc_id]) {
pr_err("two %sspeed descriptors for EP %d\n", pr_err("two %sspeed descriptors for EP %d\n",
speed_names[ep_desc_id], speed_names[ep_desc_id],
ds->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); usb_endpoint_num(ds));
return -EINVAL; return -EINVAL;
} }
ffs_ep->descs[ep_desc_id] = ds; ffs_ep->descs[ep_desc_id] = ds;