From: "Limonciello, Mario" <Mario.Limonciello@amd.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
"Prasad, Prasad" <venkataprasad.potturu@amd.com>,
"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Peter Zijlstra <peterz@infradead.org>,
"open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<linux-sound@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] ASoC: amd: use int type to store negative error codes
Date: Thu, 28 Aug 2025 13:30:01 +0000 [thread overview]
Message-ID: <1ed8cbda-e594-4a53-8801-78c03093ac55@amd.com> (raw)
In-Reply-To: <20250828075406.386208-2-rongqianfeng@vivo.com>
On 8/28/25 2:53 AM, Qianfeng Rong wrote:
> 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@vivo.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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;
next prev parent reply other threads:[~2025-08-28 13:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 7:53 [PATCH 0/3] ASoC: use int type to store negative error codes Qianfeng Rong
2025-08-28 7:53 ` [PATCH 1/3] ASoC: amd: " Qianfeng Rong
2025-08-28 13:30 ` Limonciello, Mario [this message]
2025-08-28 7:53 ` [PATCH 2/3] ASoC: adau1977: " Qianfeng Rong
2025-08-28 10:48 ` Nuno Sá
2025-08-28 7:53 ` [PATCH 3/3] ASoC: qcom: " Qianfeng Rong
2025-08-28 10:32 ` Dmitry Baryshkov
2025-08-28 21:00 ` [PATCH 0/3] ASoC: " Mark Brown
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=1ed8cbda-e594-4a53-8801-78c03093ac55@amd.com \
--to=mario.limonciello@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peterz@infradead.org \
--cc=rongqianfeng@vivo.com \
--cc=tiwai@suse.com \
--cc=venkataprasad.potturu@amd.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.