From: Takashi Iwai <tiwai@suse.de>
To: "Yury Norov (NVIDIA)" <yury.norov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH 04/21] ALSA: rename BITS to R_BITS
Date: Mon, 27 Oct 2025 10:09:28 +0100 [thread overview]
Message-ID: <87frb43e47.wl-tiwai@suse.de> (raw)
In-Reply-To: <20251025162858.305236-5-yury.norov@gmail.com>
On Sat, 25 Oct 2025 18:28:40 +0200,
Yury Norov (NVIDIA) wrote:
>
> In preparation for adding generic BITS() macro, rename the local one.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
I suppose it'll be taken together with other patches?
If so,
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
> ---
> sound/core/oss/rate.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/sound/core/oss/rate.c b/sound/core/oss/rate.c
> index b56eeda5e30e..90a40221e4ce 100644
> --- a/sound/core/oss/rate.c
> +++ b/sound/core/oss/rate.c
> @@ -25,8 +25,8 @@
> #include "pcm_plugin.h"
>
> #define SHIFT 11
> -#define BITS (1<<SHIFT)
> -#define R_MASK (BITS-1)
> +#define R_BITS (1<<SHIFT)
> +#define R_MASK (R_BITS-1)
>
> /*
> * Basic rate conversion plugin
> @@ -104,7 +104,7 @@ static void resample_expand(struct snd_pcm_plugin *plugin,
> src += src_step;
> }
> }
> - val = S1 + ((S2 - S1) * (signed int)pos) / BITS;
> + val = S1 + ((S2 - S1) * (signed int)pos) / R_BITS;
> if (val < -32768)
> val = -32768;
> else if (val > 32767)
> @@ -162,7 +162,7 @@ static void resample_shrink(struct snd_pcm_plugin *plugin,
> }
> if (pos & ~R_MASK) {
> pos &= R_MASK;
> - val = S1 + ((S2 - S1) * (signed int)pos) / BITS;
> + val = S1 + ((S2 - S1) * (signed int)pos) / R_BITS;
> if (val < -32768)
> val = -32768;
> else if (val > 32767)
> @@ -191,7 +191,7 @@ static snd_pcm_sframes_t rate_src_frames(struct snd_pcm_plugin *plugin, snd_pcm_
> return 0;
> data = (struct rate_priv *)plugin->extra_data;
> if (plugin->src_format.rate < plugin->dst_format.rate) {
> - res = (((frames * data->pitch) + (BITS/2)) >> SHIFT);
> + res = (((frames * data->pitch) + (R_BITS/2)) >> SHIFT);
> } else {
> res = DIV_ROUND_CLOSEST(frames << SHIFT, data->pitch);
> }
> @@ -226,7 +226,7 @@ static snd_pcm_sframes_t rate_dst_frames(struct snd_pcm_plugin *plugin, snd_pcm_
> if (plugin->src_format.rate < plugin->dst_format.rate) {
> res = DIV_ROUND_CLOSEST(frames << SHIFT, data->pitch);
> } else {
> - res = (((frames * data->pitch) + (BITS/2)) >> SHIFT);
> + res = (((frames * data->pitch) + (R_BITS/2)) >> SHIFT);
> }
> if (data->old_dst_frames > 0) {
> snd_pcm_sframes_t frames1 = frames, res1 = data->old_src_frames;
> --
> 2.43.0
>
next prev parent reply other threads:[~2025-10-27 9:09 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-25 16:28 [PATCH 00/21] lib: add alternatives for GENMASK() Yury Norov (NVIDIA)
2025-10-25 16:28 ` [PATCH 01/21] arc: disasm: rename BITS() for FIELD() Yury Norov (NVIDIA)
2025-10-25 16:28 ` Yury Norov (NVIDIA)
2025-10-25 16:28 ` [PATCH 02/21] iwlwifi: drop unused BITS() Yury Norov (NVIDIA)
2025-10-25 16:28 ` [PATCH 03/21] select: rename BITS() to FDS_BITS() Yury Norov (NVIDIA)
2025-10-25 16:28 ` [PATCH 04/21] ALSA: rename BITS to R_BITS Yury Norov (NVIDIA)
2025-10-27 9:09 ` Takashi Iwai [this message]
2025-10-25 16:28 ` [PATCH 05/21] zlib: rename BITS() to LOWBITS() Yury Norov (NVIDIA)
2025-10-25 16:28 ` [PATCH 06/21] mfd: prepare to generalize BITS() macro Yury Norov (NVIDIA)
2025-11-06 16:48 ` Lee Jones
2025-10-25 16:28 ` [PATCH 07/21] bits: Add " Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 08/21] mfd: drop local " Yury Norov (NVIDIA)
2025-10-27 22:21 ` Linus Walleij
2025-10-25 16:32 ` [PATCH 09/21] bits: generalize BITMAP_{FIRST,LAST}_WORD_MASK Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 10/21] i2c: nomadik: don't use GENMASK() Yury Norov (NVIDIA)
2025-10-27 22:22 ` Linus Walleij
2025-10-25 16:32 ` [PATCH 11/21] drivers: don't use GENMASK() in FIELD_PREP_WM16() Yury Norov (NVIDIA)
2025-10-25 16:32 ` Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 12/21] bitmap: don't use GENMASK() Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 13/21] trace: " Yury Norov (NVIDIA)
2025-10-25 19:29 ` Steven Rostedt
2025-10-25 19:36 ` Steven Rostedt
2025-10-25 16:32 ` [PATCH 14/21] lib: 842: don't use GENMASK_ULL() Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 15/21] bpf: don't use GENMASK() Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 16/21] kcsan: " Yury Norov (NVIDIA)
2025-10-25 16:32 ` [PATCH 17/21] mm: " Yury Norov (NVIDIA)
2025-10-25 16:33 ` [PATCH 18/21] fprobe: " Yury Norov (NVIDIA)
2025-10-25 16:33 ` [PATCH 19/21] fs: " Yury Norov (NVIDIA)
2025-10-25 16:33 ` [f2fs-dev] " Yury Norov (NVIDIA)
2025-10-25 16:33 ` [PATCH 20/21] fortify-string: " Yury Norov (NVIDIA)
2025-10-25 16:33 ` [PATCH 21/21] Docs: add Functions parameters order section Yury Norov (NVIDIA)
2025-10-27 9:02 ` Jani Nikula
2025-10-27 16:08 ` Jeff Johnson
2025-10-27 18:22 ` Andi Shyti
2025-10-27 18:43 ` Randy Dunlap
2025-10-25 16:37 ` [PATCH 00/21] lib: add alternatives for GENMASK() Yury Norov
-- strict thread matches above, loose matches on Subject: below --
2025-10-25 16:39 Yury Norov (NVIDIA)
2025-10-25 16:40 ` [PATCH 04/21] ALSA: rename BITS to R_BITS Yury Norov (NVIDIA)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87frb43e47.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=nicolas.frattaroli@collabora.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=torvalds@linux-foundation.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.