Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1814219pxm; Fri, 4 Mar 2022 04:10:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJylWsMwSiXUQKNyTITmwCxXQmdzlKGLDd6DEVwVygV3QbkwZaZdlxjtmQtIc+N8wP9UGPvL X-Received: by 2002:a17:90b:1e0b:b0:1bf:5bd:22ba with SMTP id pg11-20020a17090b1e0b00b001bf05bd22bamr10367193pjb.244.1646395848847; Fri, 04 Mar 2022 04:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646395848; cv=none; d=google.com; s=arc-20160816; b=cCWKroVU9+DoUGs7IJw4WFVgSThXaepaAVKIz+cIB63m39Y8XQ7mtpI1gyW9Vre80A MRClYRXcB/MjB/QkUON81qY3wt7JbI5w1bFcRkdnYUinIWQMSeak/30Jys07/3q71+Jc e93Psd/3ySxQVJUBc7PqAW7EcXX6igxIcapwI/Jtlp5EPWe+nJp7hwA8IQlG+zR80kMO D7p9hqW3VTnQphgNbzk8xVaXvH601WA678RfJLyfaAS1LsgZphO+ELCjevooX6PRx4Dy MuPiZidwDV1PtyqDQgLHGT5tvbqrj8IUVkGurrNA5xNAhqEV4IOvQwajGjCB0wS96lFd 5j8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6XWEbTmiJDuHm9Ux2zcdixwYoOzHkgVBj8WJ5RYcJq4=; b=LaK2pC8MY6ttxjEdih7kMZn/unkT8BUnoUWZ4/EDYKckuBrt/C/PiLOJaQvmvJRwWx g1DOoxOCFfZPTtDU4DQWt4TC2OuA1P3cIh+zd/YqldymC2gKpxnKP8xc5qPKg6hN2srK rdvWZWzsHvpM0F9yJGwfPTRtEudGy+bf3jpzGKiHKZCXfAeD8wTqOuIUbjxI4HNkUHm8 XceBoHi+Hls96+u3nuEkOKEC41xves+gHtqMDrw0EnHOs8Yj+TSkQ0elESCKIp/AJoWV gKz1lPXprllJlgxe4TC78GTK/1fZSSdk1PoOgIpHrj/0fHxF7VpROBKwSe74ff40jjl+ Wx8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d187-20020a6368c4000000b0035d9af504dbsi4585993pgc.427.2022.03.04.04.10.33; Fri, 04 Mar 2022 04:10:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237433AbiCDAql (ORCPT + 99 others); Thu, 3 Mar 2022 19:46:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235493AbiCDAqf (ORCPT ); Thu, 3 Mar 2022 19:46:35 -0500 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18F415DB35 for ; Thu, 3 Mar 2022 16:45:48 -0800 (PST) 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 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 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- --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; -- 2.20.1.7.g153144c