From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EBDF5013C9; Wed, 30 Sep 2026 16:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790785175; cv=none; b=n3DkC/A3F5V+zJGfXewx1iPBgzvi7mYyC1MQZUPJ4RBF8S/39soQSj+noYQ/H/yWh2UYOhAIK9dfjPB05pnQ7cw8Kk3tah1vXueAacKVDvEtQWPCmIWSLmovPLwIQ4/pgIGDZu1vMCgMuDrf5yCWu66IK9cqENsMweXxmy9wl04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790785175; c=relaxed/simple; bh=BPIUs1+hmQBreDYwo2P7sAsSbIFxpqSdWEGQM5Bho+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OwQO3FizfAaoGSysbcJ6VH9S8VhowG5jx2OYiFelnRog06g0PC6wb9ONQXe09KGoXh/jokOjnlwTw5g3WNfpi1MQpS/lMscG8H6SYlOV+nLsrM/qCHnKOluRuuy1LdqkdUFN3ezPO82z3FCWJa5mWV0Lw1LEg87lXEkqgH8ZZXE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Zsp9SJU7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Zsp9SJU7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E43B71F000FF; Wed, 30 Sep 2026 16:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790785172; bh=0QeE8PwO0Ag0tmTSQG2CeAVhgk6T43Jq3pavVzJUI8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Zsp9SJU71X5a78BQOW9Z976+/l99CGDl/amYl3BE8eGGI1JZflaVjqbjdA1lLgDl7 sS4PfgG9ebkz7eZxrG1VLG7tMfMT4aLDOQXAcofhVRCa9bR8eHFIQdLmSvlMrM0IwQ h9lRtoKhl2iEjPfbGNUM5acXsWqd0MJP3fp0BVt4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, HyeongJun An , Takashi Iwai , Sasha Levin Subject: [PATCH 6.1 398/982] selftests/alsa: Fix the step check for INTEGER controls Date: Wed, 30 Sep 2026 17:18:54 +0200 Message-ID: <20260930152425.357673149@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: HyeongJun An [ Upstream commit 8efd5f623c63584c2e284a837a7795d95a0491cb ] The modulo sits inside the subtraction, so the check evaluates int_val - (min % step) rather than (int_val - min) % step. The INTEGER64 branch below it is parenthesised correctly. The written form passes only when the value equals min % step, and such a value is always on a step boundary, so it never misses a real violation. It only reports valid values as invalid. snd-aloop declares step 1 on four controls, so every non-zero value on them is reported. Before: # PCM Rate Shift 100000.0 value 100000 invalid for step 1 minimum 80000 # Totals: pass:660 fail:101 xfail:0 xpass:0 skip:296 error:0 After, same card, nothing else changed: # Totals: pass:740 fail:21 xfail:0 xpass:0 skip:296 error:0 Eighteen files under sound/ declare a non-zero step. Fixes: 5aaf9efffc57 ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest") Signed-off-by: HyeongJun An Assisted-by: Claude:claude-opus-5 Link: https://patch.msgid.link/20260903123832.97377-1-sammiee5311@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- tools/testing/selftests/alsa/mixer-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c index 960b137789d25..a3fb3f708f9e7 100644 --- a/tools/testing/selftests/alsa/mixer-test.c +++ b/tools/testing/selftests/alsa/mixer-test.c @@ -338,8 +338,8 @@ static bool ctl_value_index_valid(struct ctl_data *ctl, /* Only check step size if there is one and we're in bounds */ if (snd_ctl_elem_info_get_step(ctl->info) && - (int_val - snd_ctl_elem_info_get_min(ctl->info) % - snd_ctl_elem_info_get_step(ctl->info))) { + (int_val - snd_ctl_elem_info_get_min(ctl->info)) % + snd_ctl_elem_info_get_step(ctl->info)) { ksft_print_msg("%s.%d value %ld invalid for step %ld minimum %ld\n", ctl->name, index, int_val, snd_ctl_elem_info_get_step(ctl->info), -- 2.53.0