]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: usb: fcp: Use USB API functions rather than constants
authorChen Ni <nichen@iscas.ac.cn>
Fri, 16 May 2025 07:09:38 +0000 (15:09 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 16 May 2025 07:57:00 +0000 (09:57 +0200)
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://patch.msgid.link/20250516070938.12520-1-nichen@iscas.ac.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/fcp.c

index 7df65041ace5563fe1541a2e5e98daed2eb92a44..98f9964311a735cd0a16a2fc6cd0addee7b90128 100644 (file)
@@ -1092,8 +1092,7 @@ static int fcp_find_fc_interface(struct usb_mixer_interface *mixer)
 
                epd = get_endpoint(intf->altsetting, 0);
                private->bInterfaceNumber = desc->bInterfaceNumber;
-               private->bEndpointAddress = epd->bEndpointAddress &
-                       USB_ENDPOINT_NUMBER_MASK;
+               private->bEndpointAddress = usb_endpoint_num(epd);
                private->wMaxPacketSize = le16_to_cpu(epd->wMaxPacketSize);
                private->bInterval = epd->bInterval;
                return 0;