From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <kovalev@altlinux.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
 sa.local.altlinux.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
 autolearn=unavailable autolearn_force=no version=3.4.1
From: kovalev@altlinux.org
To: devel-kernel@lists.altlinux.org
Date: Wed,  6 Dec 2023 19:44:13 +0300
Message-Id: <20231206164413.126554-8-kovalev@altlinux.org>
X-Mailer: git-send-email 2.33.8
In-Reply-To: <20231206164413.126554-1-kovalev@altlinux.org>
References: <20231206164413.126554-1-kovalev@altlinux.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [d-kernel] [PATCH 7/7] ASoC: codecs: fix warning for the es8316
	codec build
X-BeenThere: devel-kernel@lists.altlinux.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: ALT Linux kernel packages development
 <devel-kernel@lists.altlinux.org>
List-Id: ALT Linux kernel packages development
 <devel-kernel.lists.altlinux.org>
List-Unsubscribe: <https://lists.altlinux.org/mailman/options/devel-kernel>,
 <mailto:devel-kernel-request@lists.altlinux.org?subject=unsubscribe>
List-Archive: <http://lists.altlinux.org/pipermail/devel-kernel>
List-Post: <mailto:devel-kernel@lists.altlinux.org>
List-Help: <mailto:devel-kernel-request@lists.altlinux.org?subject=help>
List-Subscribe: <https://lists.altlinux.org/mailman/listinfo/devel-kernel>,
 <mailto:devel-kernel-request@lists.altlinux.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Dec 2023 16:44:42 -0000
Archived-At: <http://lore.altlinux.org/devel-kernel/20231206164413.126554-8-kovalev@altlinux.org/>
List-Archive: <http://lore.altlinux.org/devel-kernel/>
List-Post: <mailto:devel-kernel@altlinux.org>

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..754d9e62a7e6a2 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 flag_print_div_once = 0;
+
 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 (!flag_print_div_once) {
+		flag_print_div_once = 1;
 		if (mclk_div == 2)
 			dev_info(component->dev, "Activating MCLK div by 2\n");
 
-- 
2.33.8