[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251025162858.305236-5-yury.norov@gmail.com>
Date: Sat, 25 Oct 2025 12:28:40 -0400
From: "Yury Norov (NVIDIA)" <yury.norov@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
"Yury Norov (NVIDIA)" <yury.norov@...il.com>,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH 04/21] ALSA: rename BITS to R_BITS
In preparation for adding generic BITS() macro, rename the local one.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>
---
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
Powered by blists - more mailing lists