From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796221611; b=r9G2jqsStIocobrRwGaw1TrIHC6VkbLu4Rb0qYubcV6PTozIARgEDCsYpGc6EfgaObXJ RnvJX9SwD5FIcm6PwdRpz5kxDKvmFx50MFmyKLha/NIWcDo4rEY9G5JgKsnFfAquoDE4+ IkJts4QDQ27XPfghM3G5SbM0VLRXgFfFYaK6drS9IFMpgImXn2Jszkxm8gqxne59qruB/ 2ul47HHiMNydWVpjXjueZ0jPHAMlDvurvfW3/keG37nRYjDZH913VR3BKDQCOGsoVLhME gHQMd3+hzPOKwfD/T8vGitk3TQem11xdSJlYWJ4W6stjbCWFHdUXK8ILn2qoVVlhGWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221611; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=iFzWp/1r6xak9bivGH4g79J+vJTwgqgczcnt9kbTZV0=; b=n6yUsLy+brK9N8daP2/PxR5tjkoasWa3aHDbu+hJO/4qa5/g4YIble5ojzX6p2bqGiA/ c1YAj9YXqs06/2h7R9IjAvwO32X91rd2CyVZpJ1HNIwF8JQqEH1d0uwjIaEpmDvYtsHGY XRGptaG012UnKP8xoBgMCJAgoyKZLmF6xiuRr7BBlJEy0XIeNklQwZhyCH4/USMdAH2IH l+5K89Wh5NFeLZv1MqvZ4tjoqKPsk+lUSEIXzDCY/zddMjIL24U4LhslGtPuPCua/KgBO BeD6DW+9JbZ7gNK5IxFPoeU6yGM+PMf96gXdSSl1WmRxe/uoQ9Z9gctg036pL90CsZg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Tdn+S8tQ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0815606A322 for ; Wed, 2 Dec 2026 14:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Tdn+S8tQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEC681F0089C; Wed, 2 Dec 2026 14:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796221611; bh=iFzWp/1r6xak9bivGH4g79J+vJTwgqgczcnt9kbTZV0=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Tdn+S8tQxAJec+qWzR0Aw2nUqNu7c7G6chtxLIhxq7h0ZpbFTMa3GXXUkdrFuEOJ3 aaU5/QrO6iCygZR0Qo7YdqTEV7CUV9alA4D40tmNPCwXeI0CqwUh7fQhquMDeFzfsA ceXAxErlGcZHq8UwsiFWxBBVYHp0LyaLC5GucvCL46rHAXB0kmCxpMxxHC4bJzxwJn FfPJ7ZEA2lJx7bp4y20ymEBbrPGXXhDhiIqYeAgUbCr163MuOX3TMLzhpj09DJvi+r MFqs2iBbBTzqsiZU9Bht24uu+P6uwmIgGPbhq02u+zf8tgfZ86CPYSkOg5E/WsgPsq /DpBEM5NU4Lyg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ALSA: usb-audio: Fix missing 64bit conversions for 64 channel enhancement Reply-To: sashiko-reviews@lists.linux.dev To: "Takashi Iwai" , linux-sound@vger.kernel.org In-Reply-To: <20261202141631.688337-1-tiwai@suse.de> References: <20261202141631.688337-1-tiwai@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 14:26:50 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] ALSA: usb-audio: unconverted 32-bit BIT(j) in parse_audio_feature_unit() -- commit c7574dcbffc09488f93abce794f2df8e79705058 Author: Takashi Iwai ALSA: usb-audio: Fix missing 64bit conversions for 64 channel enhancement This commit converts channel bitmasks and BIT() usages in the USB audio mixer to 64-bit types and BIT_U64() to support up to 64 mixer channels. > diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c > index 37850f34caaea..a16c11a7b79fb 100644 > --- a/sound/usb/mixer.c > +++ b/sound/usb/mixer.c [ ... ] > @@ -2317,7 +2317,7 @@ static int parse_audio_feature_unit(struct mixer_bu= ild *state, int unitid, > } else { /* UAC_VERSION_2/3 */ > for (i =3D 0; i < ARRAY_SIZE(audio_feature_info); i++) { > u64 ch_bits =3D 0; > - unsigned int ch_read_only =3D 0; > + u64 ch_read_only =3D 0; > int control =3D audio_feature_info[i].control; > =20 > for (j =3D 0; j < channels; j++) { > @@ -2326,9 +2326,9 @@ static int parse_audio_feature_unit(struct mixer_bu= ild *state, int unitid, > mask =3D snd_usb_combine_bytes(bmaControls + > csize * (j+1), csize); > if (uac_v2v3_control_is_readable(mask, control)) { > - ch_bits |=3D BIT(j); > + ch_bits |=3D BIT_U64(j); > if (!uac_v2v3_control_is_writeable(mask, control)) > - ch_read_only |=3D BIT(j); > + ch_read_only |=3D BIT_U64(j); > } > } > =20 [Severity: Medium] Should the UAC_VERSION_1 branch right above this in parse_audio_feature_unit() also use BIT_U64(j) when setting ch_bits? sound/usb/mixer.c:parse_audio_feature_unit() { ... for (j =3D 0; j < channels; j++) { unsigned int mask; mask =3D snd_usb_combine_bytes(bmaControls + csize * (j+1), csize); if (mask & BIT(i)) ch_bits |=3D BIT(j); } ... } On 32-bit architectures, BIT(j) shifts a 32-bit unsigned long, so UAC1 feature units with more than 32 channels hit a shift-out-of-bounds for j >=3D 32 and fail to populate the upper 32 bits of ch_bits. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202141631.6883= 37-1-tiwai@suse.de?part=3D1