[d-kernel] [PATCH 2/2] ASoC: codecs: fix warning for the es8316 codec build (ALT)
kovalev на altlinux.org
kovalev на altlinux.org
Чт Мар 7 11:50:42 MSK 2024
From: Vasiliy Kovalev <kovalev на altlinux.org>
sound/soc/codecs/es8316.c:517:2: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
517 | static u8 only_one = 0;
| ^~~~~~
Fixes: f63b2a193575f82 ("ASoC: AMD: add ACP machine driver for ES8336")
Signed-off-by: Vasiliy Kovalev <kovalev на altlinux.org>
---
sound/soc/codecs/es8316.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index f6e3f0e7e56583..621084fbc87708 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -460,6 +460,8 @@ static int es8316_pcm_startup(struct snd_pcm_substream *substream,
return 0;
}
+static u8 static_flag;
+
static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
@@ -513,9 +515,8 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- static u8 only_one = 0;
- if (!only_one) {
- only_one = 1;
+ if (!static_flag) {
+ static_flag = 1;
if (mclk_div == 2)
dev_info(component->dev, "Activating MCLK div by 2\n");
--
2.33.8
Подробная информация о списке рассылки devel-kernel