From patchwork Fri Mar 4 00:45:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 548551 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25DB5C433F5 for ; Fri, 4 Mar 2022 00:46:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E922218FA; Fri, 4 Mar 2022 01:45:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E922218FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646354807; bh=ekPKyag5s4QlryZoQYHVV61iChFU24mQQPzWP7R3uw0=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=fqBQA50nmktIXtR1ByX8ChLpzLdTzGAIoJSzACPWWciIMxfqEHAHlpMYOUpMh/IBW itd1/rEJ0AiF1y1Vfv12SqaU2ckLPgylX9XObDvF/8ItZNJlt5ZhGHRvUGqdwou4Fh hZ8U7pcH3KLipuRGYH9fpzYQCTMvflmlWlJuCaqE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 87C6CF80149; Fri, 4 Mar 2022 01:45:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9041F80152; Fri, 4 Mar 2022 01:45:54 +0100 (CET) Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8DE2DF8013D for ; Fri, 4 Mar 2022 01:45:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8DE2DF8013D X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R191e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04400; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=9; SR=0; TI=SMTPD_---0V69clCD_1646354745; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V69clCD_1646354745) by smtp.aliyun-inc.com(127.0.0.1); Fri, 04 Mar 2022 08:45:45 +0800 From: Yang Li To: broonie@kernel.org Subject: [PATCH -next v2] ASoC: amd: Fix an ignored error return from platform_get_irq_byname() Date: Fri, 4 Mar 2022 08:45:43 +0800 Message-Id: <20220304004543.11797-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, tangmeng@uniontech.com, Abaci Robot , tiwai@suse.com, lgirdwood@gmail.com, Yang Li , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 --- --Changes in v2: Report the error code is being returned rather than squashing it down to -ENODEV. sound/soc/amd/acp/acp-renoir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index 738cf2e2b973..21e5c9744784 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -282,9 +282,9 @@ 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) - return -ENODEV; + adata->i2s_irq = ret = platform_get_irq_byname(pdev, "acp_dai_irq"); + if (ret < 0) + return ret; adata->dev = dev; adata->dai_driver = acp_renoir_dai;