From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E700BC433F5 for ; Tue, 1 Mar 2022 06:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232714AbiCAGuJ (ORCPT ); Tue, 1 Mar 2022 01:50:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232697AbiCAGuG (ORCPT ); Tue, 1 Mar 2022 01:50:06 -0500 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF4AD50B37 for ; Mon, 28 Feb 2022 22:49:25 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0V5t7p1Q_1646117362; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V5t7p1Q_1646117362) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Mar 2022 14:49:22 +0800 From: Yang Li To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, tangmeng@uniontech.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] ASoC: amd: Fix an ignored error return from platform_get_irq_byname() Date: Tue, 1 Mar 2022 14:49:20 +0800 Message-Id: <20220301064920.37788-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 3304a242f45a ("ASoC: amd: Use platform_get_irq_byname() to get the interrupt") Signed-off-by: Yang Li --- 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