* [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
@ 2022-03-01 6:49 Yang Li
2022-03-01 12:39 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Yang Li @ 2022-03-01 6:49 UTC (permalink / raw)
To: broonie
Cc: alsa-devel, tangmeng, Abaci Robot, tiwai, lgirdwood, Yang Li,
linux-kernel
The return from the call to platform_get_irq_byname() is int, it can be
a negative error code, however this is being assigned to an unsigned
int variable 'adata->i2s_irq', so assign the value to 'ret' concurrently
to solve this problem without affecting other functions.
Eliminate the following coccicheck warning:
./sound/soc/amd/acp/acp-renoir.c:286:5-19: WARNING: Unsigned expression
compared with zero: adata -> i2s_irq < 0
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 3304a242f45a ("ASoC: amd: Use platform_get_irq_byname() to get the interrupt")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
sound/soc/amd/acp/acp-renoir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c
index 738cf2e2b973..64e824161091 100644
--- a/sound/soc/amd/acp/acp-renoir.c
+++ b/sound/soc/amd/acp/acp-renoir.c
@@ -282,8 +282,8 @@ static int renoir_audio_probe(struct platform_device *pdev)
if (!adata->acp_base)
return -ENOMEM;
- adata->i2s_irq = platform_get_irq_byname(pdev, "acp_dai_irq");
- if (adata->i2s_irq < 0)
+ adata->i2s_irq = ret = platform_get_irq_byname(pdev, "acp_dai_irq");
+ if (ret < 0)
return -ENODEV;
adata->dev = dev;
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
2022-03-01 6:49 [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname() Yang Li
@ 2022-03-01 12:39 ` Mark Brown
2022-03-02 1:17 ` 回复:[PATCH " Yang.Lee
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2022-03-01 12:39 UTC (permalink / raw)
To: Yang Li; +Cc: alsa-devel, tangmeng, Abaci Robot, tiwai, lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Tue, Mar 01, 2022 at 02:49:20PM +0800, Yang Li wrote:
> - adata->i2s_irq = platform_get_irq_byname(pdev, "acp_dai_irq");
> - if (adata->i2s_irq < 0)
> + adata->i2s_irq = ret = platform_get_irq_byname(pdev, "acp_dai_irq");
> + if (ret < 0)
> return -ENODEV;
If an error code is being returned we should report that error code
rather than squashing it down to -ENODEV.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复:[PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
2022-03-01 12:39 ` Mark Brown
@ 2022-03-02 1:17 ` Yang.Lee
2022-03-02 13:11 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Yang.Lee @ 2022-03-02 1:17 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, tangmeng, Abaci Robot, tiwai, lgirdwood, linux-kernel
The function dev_err_probe() is called in function platform_get_irq_byname() to print the error code.
------------------------------------------------------------------
发件人:Mark Brown <broonie@kernel.org>
发送时间:2022年3月1日(星期二) 20:40
收件人:Yang Li <yang.lee@linux.alibaba.com>
抄 送:lgirdwood <lgirdwood@gmail.com>; perex <perex@perex.cz>; tiwai <tiwai@suse.com>; tangmeng <tangmeng@uniontech.com>; alsa-devel <alsa-devel@alsa-project.org>; linux-kernel <linux-kernel@vger.kernel.org>; Abaci Robot <abaci@linux.alibaba.com>
主 题:Re: [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
On Tue, Mar 01, 2022 at 02:49:20PM +0800, Yang Li wrote:
> - adata->i2s_irq = platform_get_irq_byname(pdev, "acp_dai_irq");
> - if (adata->i2s_irq < 0)
> + adata->i2s_irq = ret = platform_get_irq_byname(pdev, "acp_dai_irq");
> + if (ret < 0)
> return -ENODEV;
If an error code is being returned we should report that error code
rather than squashing it down to -ENODEV.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 回复:[PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
2022-03-02 1:17 ` 回复:[PATCH " Yang.Lee
@ 2022-03-02 13:11 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-03-02 13:11 UTC (permalink / raw)
To: Yang.Lee
Cc: alsa-devel, tangmeng, Abaci Robot, tiwai, lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 811 bytes --]
On Wed, Mar 02, 2022 at 09:17:21AM +0800, Yang.Lee wrote:
Please don't top post, reply in line with needed context. This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.
> The function dev_err_probe() is called in function platform_get_irq_byname() to print the error code.
That doesn't seem at all relevant to the error code being returned which
is what the review feedback was about:
> > If an error code is being returned we should report that error code
> > rather than squashing it down to -ENODEV.
Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns. Doing this makes your messages much
easier to read and reply to.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-02 13:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-01 6:49 [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname() Yang Li
2022-03-01 12:39 ` Mark Brown
2022-03-02 1:17 ` 回复:[PATCH " Yang.Lee
2022-03-02 13:11 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox