]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: usb-audio: Replace hard-coded number with MAX_CHANNELS
authorTakashi Iwai <tiwai@suse.de>
Fri, 27 Mar 2026 15:30:53 +0000 (16:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Mar 2026 15:32:07 +0000 (16:32 +0100)
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 <willerz@gmail.com>
Link: https://patch.msgid.link/20260327153056.691575-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c

index 7007e0c9489b40a16820580064bfbe4963d2537f..e764757979e009ac1a4dd26cbab62e24b266c19b 100644 (file)
@@ -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;