* [PATCH] ALSA: scarlett2: Use USB API functions rather than constants
@ 2025-05-16 7:04 Chen Ni
2025-05-16 7:57 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2025-05-16 7:04 UTC (permalink / raw)
To: g, perex, tiwai; +Cc: linux-sound, linux-kernel, Chen Ni
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>
---
sound/usb/mixer_scarlett2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index 288d22e6a0b2..93589e86828a 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -8574,8 +8574,7 @@ static int scarlett2_find_fc_interface(struct usb_device *dev,
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;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: scarlett2: Use USB API functions rather than constants
2025-05-16 7:04 [PATCH] ALSA: scarlett2: Use USB API functions rather than constants Chen Ni
@ 2025-05-16 7:57 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-05-16 7:57 UTC (permalink / raw)
To: Chen Ni; +Cc: g, perex, tiwai, linux-sound, linux-kernel
On Fri, 16 May 2025 09:04:16 +0200,
Chen Ni wrote:
>
> 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>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-16 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 7:04 [PATCH] ALSA: scarlett2: Use USB API functions rather than constants Chen Ni
2025-05-16 7:57 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox