[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250828075406.386208-2-rongqianfeng@vivo.com>
Date: Thu, 28 Aug 2025 15:53:57 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Venkata Prasad Potturu <venkataprasad.potturu@....com>,
Vijendar Mukunda <Vijendar.Mukunda@....com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Mario Limonciello <mario.limonciello@....com>,
Peter Zijlstra <peterz@...radead.org>,
Qianfeng Rong <rongqianfeng@...o.com>,
linux-sound@...r.kernel.org (open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 1/3] ASoC: amd: use int type to store negative error codes
Change the 'ret' variable from u32 to int to store negative error codes
directly or returned by other functions.
Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but it's ugly as pants. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.
No effect on runtime.
Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
sound/soc/amd/acp/acp-rembrandt.c | 2 +-
sound/soc/amd/raven/acp3x-i2s.c | 3 ++-
sound/soc/amd/vangogh/acp5x-i2s.c | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index aeffd24710e7..7e9c07488dcc 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -147,7 +147,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct acp_chip_info *chip;
- u32 ret;
+ int ret;
chip = dev_get_platdata(&pdev->dev);
if (!chip || !chip->base) {
diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c
index e7f2a05e802c..352485dd98b1 100644
--- a/sound/soc/amd/raven/acp3x-i2s.c
+++ b/sound/soc/amd/raven/acp3x-i2s.c
@@ -149,8 +149,9 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct i2s_stream_instance *rtd;
- u32 ret, val, period_bytes, reg_val, ier_val, water_val;
+ u32 val, period_bytes, reg_val, ier_val, water_val;
u32 buf_size, buf_reg;
+ int ret;
rtd = substream->runtime->private_data;
period_bytes = frames_to_bytes(substream->runtime,
diff --git a/sound/soc/amd/vangogh/acp5x-i2s.c b/sound/soc/amd/vangogh/acp5x-i2s.c
index 7dbe33f4b867..bf719f628617 100644
--- a/sound/soc/amd/vangogh/acp5x-i2s.c
+++ b/sound/soc/amd/vangogh/acp5x-i2s.c
@@ -234,8 +234,9 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream,
{
struct i2s_stream_instance *rtd;
struct i2s_dev_data *adata;
- u32 ret, val, period_bytes, reg_val, ier_val, water_val;
+ u32 val, period_bytes, reg_val, ier_val, water_val;
u32 buf_size, buf_reg;
+ int ret;
adata = snd_soc_dai_get_drvdata(dai);
rtd = substream->runtime->private_data;
--
2.34.1
Powered by blists - more mailing lists