From: Takashi Iwai Date: Fri, 27 Mar 2026 15:30:53 +0000 (+0100) Subject: ALSA: usb-audio: Replace hard-coded number with MAX_CHANNELS X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec9a788620be1c11535fe99e9b2779f9eef2b099;p=thirdparty%2Flinux.git ALSA: usb-audio: Replace hard-coded number with MAX_CHANNELS One place in mixer.c still used a hard-coded number 16 instead of MAX_CHANNELS. Replace with it, so that we can extend the max number of channels gracefully. Link: https://lore.kernel.org/F1B104A5-CD6A-4A26-AB46-14BF233C0579@getmailspring.com Tested-by: Phil Willoughby Link: https://patch.msgid.link/20260327153056.691575-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 7007e0c9489b..e764757979e0 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1769,7 +1769,7 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer, cval->master_readonly = readonly_mask; } else { int i, c = 0; - for (i = 0; i < 16; i++) + for (i = 0; i < MAX_CHANNELS; i++) if (ctl_mask & BIT(i)) c++; cval->channels = c;