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=1796390739; b=u+sJoLPtlFm8I1zS86+kJhh4MVg64NLpZNZKJCEX8YVU4Fg4/yzsF0hiTjBDPUoRdtTc 4WbMYLA/FVb56PySg6NCeJ6hR6p69I/f+izNo+8Ex70RZmlUdZzCNV0jmkOh2Sl0F+SsM LmnIU5h/vxcf3OEjszRQkLJU4hLpaPqhoMH5K28HFrAjblH0orT0U/qMQ0kfibxdpqfZG x6IiE26bngUZ0Z1eiRKsOxaWpGaBE8/NKTVxHJt0CFT6fvICDMQ7JstbbCjsYQ9kSEFYY 8uMgokZIo8t94eyPw40NVdquqqt/Ftu5dTh1DaG1BLhCP9zZodftq/KX8a7IQuMrFug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796390739; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=m7AWt4BTZsG/SQ9zPkQiccccxm2JDg92abeGnQp5Hq4=; b=I5+eC4Kre7V0QuFTS377bdyGdUVun1HIDlnOXO43Qg7U2iKm7CuIa4UolNxPupUUhR59 a+pxBzDGpLLB9NwsF0vh+BKL0WOohwIRYxEkPNK84D/D0CWudgE7FpuWv6GuMpyG7DTMT 2xensCxf60l4vLLqQjhcVGtro4M+9CGx9GnTJ92cilj1vXBYeH3x9flLr23PBrdTYVAhw JFQIYR1mh6C7PfOdpw5Ay1nroKFfyXAosp7KFBMi3J2ibv8Vkp5NfdnTx/DOoq3w3KRKK h/b+FUKJ0NV66dhHVPkET0hQhuZ4FK9se7+EC67z/DNYo7G1hEcWIB3d3I5NqEaT53A== 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=fBYjqm9+; 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 14703606A684 for ; Fri, 4 Dec 2026 13:25:38 +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=fBYjqm9+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id D99901F00A05; Fri, 4 Dec 2026 13:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796390738; bh=m7AWt4BTZsG/SQ9zPkQiccccxm2JDg92abeGnQp5Hq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fBYjqm9+zqRY+N6MpxjyKoC3QYQyTfFdaKzgnqsp8ioxqr+smg9r06dbmg+hJ+Ova 1qxyVPu/FdHBzcetx6YZ/wkKzfdTw/msTHhVjPuZjGwp54/csdQtOWDBAesO5rWzud y1kEP/Aev7wVk5i3z6T40kKj45Xrubcng11ECPeu8XCmrB8N1PNnvVKxcSoQ/jdNnl Ev21ghujATXw1X/kJxVM7mc5jH11J5RgZcX+D7E2cYpoIJP0kGFviPOGOryrqxlu1p 2/zNrL7/WBDcqjisG7oAT50Ab3l2LduWIz9pTvqqRLZccxD0UOk9KBhBIUGuEKOQey UuDXfOXKhieNQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Takashi Iwai , Cezary Rojewski , Sasha Levin Subject: [PATCH 6.12.y 1/2] ALSA: oss: Drop __force casts Date: Fri, 4 Dec 2026 08:25:35 -0500 Message-ID: <20261204132529.3144338-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026120327-shelf-earwig-cafa@gregkh> References: <2026120327-shelf-earwig-cafa@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Takashi Iwai [ Upstream commit 01edf81ac8577278ecbd9371078bc85f0baa65ac ] Now that the bitwise parameter definitions are gone for PCM parameters, we don't have to cast with ugly __force prefix. Simply drop those superfluous casts. Reviewed-by: Cezary Rojewski Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260812060557.80445-6-tiwai@suse.de Stable-dep-of: ddea524e437e ("ALSA: pcm: oss: Refine slave hw_params after setting format") Signed-off-by: Sasha Levin --- sound/core/oss/pcm_oss.c | 16 ++++++++-------- sound/core/oss/pcm_plugin.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 381df3bda3c90..4e8fdfdedbd01 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -877,11 +877,11 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) _snd_pcm_hw_param_min(sparams, SNDRV_PCM_HW_PARAM_PERIODS, 2, 0); snd_mask_none(&mask); if (atomic_read(&substream->mmap_count)) - snd_mask_set(&mask, (__force int)SNDRV_PCM_ACCESS_MMAP_INTERLEAVED); + snd_mask_set(&mask, SNDRV_PCM_ACCESS_MMAP_INTERLEAVED); else { - snd_mask_set(&mask, (__force int)SNDRV_PCM_ACCESS_RW_INTERLEAVED); + snd_mask_set(&mask, SNDRV_PCM_ACCESS_RW_INTERLEAVED); if (!direct) - snd_mask_set(&mask, (__force int)SNDRV_PCM_ACCESS_RW_NONINTERLEAVED); + snd_mask_set(&mask, SNDRV_PCM_ACCESS_RW_NONINTERLEAVED); } err = snd_pcm_hw_param_mask(substream, sparams, SNDRV_PCM_HW_PARAM_ACCESS, &mask); if (err < 0) { @@ -907,7 +907,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) else sformat = snd_pcm_plug_slave_format(format, sformat_mask); - if ((__force int)sformat < 0 || + if (sformat < 0 || !snd_mask_test_format(sformat_mask, sformat)) { pcm_for_each_format(sformat) { if (snd_mask_test_format(sformat_mask, sformat) && @@ -919,7 +919,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) goto failure; } format_found: - err = _snd_pcm_hw_param_set(sparams, SNDRV_PCM_HW_PARAM_FORMAT, (__force int)sformat, 0); + err = _snd_pcm_hw_param_set(sparams, SNDRV_PCM_HW_PARAM_FORMAT, sformat, 0); if (err < 0) goto failure; @@ -928,9 +928,9 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) } else { _snd_pcm_hw_params_any(params); _snd_pcm_hw_param_set(params, SNDRV_PCM_HW_PARAM_ACCESS, - (__force int)SNDRV_PCM_ACCESS_RW_INTERLEAVED, 0); + SNDRV_PCM_ACCESS_RW_INTERLEAVED, 0); _snd_pcm_hw_param_set(params, SNDRV_PCM_HW_PARAM_FORMAT, - (__force int)snd_pcm_oss_format_from(runtime->oss.format), 0); + snd_pcm_oss_format_from(runtime->oss.format), 0); _snd_pcm_hw_param_set(params, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, 0); _snd_pcm_hw_param_set(params, SNDRV_PCM_HW_PARAM_RATE, @@ -1868,7 +1868,7 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file) format_mask = hw_param_mask_c(params, SNDRV_PCM_HW_PARAM_FORMAT); for (fmt = 0; fmt < 32; ++fmt) { if (snd_mask_test(format_mask, fmt)) { - int f = snd_pcm_oss_format_to((__force snd_pcm_format_t)fmt); + int f = snd_pcm_oss_format_to(fmt); if (f >= 0) formats |= f; } diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 82e180c776ae1..fd2f26283e5d9 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -287,13 +287,13 @@ static int snd_pcm_plug_formats(const struct snd_mask *mask, SNDRV_PCM_FMTBIT_U24_3BE | SNDRV_PCM_FMTBIT_S24_3BE | SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_BE | SNDRV_PCM_FMTBIT_S32_BE); - snd_mask_set(&formats, (__force int)SNDRV_PCM_FORMAT_MU_LAW); + snd_mask_set(&formats, SNDRV_PCM_FORMAT_MU_LAW); if (formats.bits[0] & lower_32_bits(linfmts)) formats.bits[0] |= lower_32_bits(linfmts); if (formats.bits[1] & upper_32_bits(linfmts)) formats.bits[1] |= upper_32_bits(linfmts); - return snd_mask_test(&formats, (__force int)format); + return snd_mask_test(&formats, format); } static const snd_pcm_format_t preferred_formats[] = { @@ -322,20 +322,20 @@ snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, { int i; - if (snd_mask_test(format_mask, (__force int)format)) + if (snd_mask_test(format_mask, format)) return format; if (!snd_pcm_plug_formats(format_mask, format)) - return (__force snd_pcm_format_t)-EINVAL; + return -EINVAL; if (snd_pcm_format_linear(format)) { unsigned int width = snd_pcm_format_width(format); int unsignd = snd_pcm_format_unsigned(format) > 0; int big = snd_pcm_format_big_endian(format) > 0; unsigned int badness, best = -1; - snd_pcm_format_t best_format = (__force snd_pcm_format_t)-1; + snd_pcm_format_t best_format = -1; for (i = 0; i < ARRAY_SIZE(preferred_formats); i++) { snd_pcm_format_t f = preferred_formats[i]; unsigned int w; - if (!snd_mask_test(format_mask, (__force int)f)) + if (!snd_mask_test(format_mask, f)) continue; w = snd_pcm_format_width(f); if (w >= width) @@ -349,21 +349,21 @@ snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, best = badness; } } - if ((__force int)best_format >= 0) + if (best_format >= 0) return best_format; else - return (__force snd_pcm_format_t)-EINVAL; + return -EINVAL; } else { switch (format) { case SNDRV_PCM_FORMAT_MU_LAW: for (i = 0; i < ARRAY_SIZE(preferred_formats); ++i) { snd_pcm_format_t format1 = preferred_formats[i]; - if (snd_mask_test(format_mask, (__force int)format1)) + if (snd_mask_test(format_mask, format1)) return format1; } fallthrough; default: - return (__force snd_pcm_format_t)-EINVAL; + return -EINVAL; } } } -- 2.53.0