Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp892533rwl; Fri, 24 Mar 2023 03:33:37 -0700 (PDT) X-Google-Smtp-Source: AKy350aGDbtE2cS91gewvFaNdHdS+36PMizEm9K/LD4x+fzIBS6uX1/ugWAepmRtgkX6ZG5WECPm X-Received: by 2002:a17:907:c209:b0:8de:502e:2061 with SMTP id ti9-20020a170907c20900b008de502e2061mr2230347ejc.3.1679654017395; Fri, 24 Mar 2023 03:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679654017; cv=none; d=google.com; s=arc-20160816; b=m8fCwLAEyacBVjb5D5kXVUwF7K3BUvx/IZF8fLPz5NesqYex5LizIHBUEvU2CyBixA LHs47zYRu9uTZTWPdc7CrFuEp9tD4TIuYeqETL6oTJjLqFe6IxL3fR50KYIlLo8hBaTH J0SG8ckNvRr+pmnYgPgry/iKsD3ktvpRLw4u/KmU/+bl4yDpkVIJD247lN6uW9CpDQbQ maQr07noo0w46ZmuvSuEmj/oCmPhoQr6PuLf+hVwazYV4+CE7THQZIsgeynu7TvFkINa Z/QawZChqz2nQ06zqObMi1bcTOaspuOpxCkbH0x/WsLchsyiJNp2YCDvi4GHipWqszMu QFDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=H3Al6fxftb4sYSq8AeR6Z82rHyYTeUIs6TxuWGnCgFc=; b=Nd+VZr17pqcKUk8tH7TPhp4OfFgtCYO3dzLgC7gcW2fWsheCAVKp3RLM3sBjq4IZ+L kXf6c4qoLHyuiPbB7g4fCMzLoc0rvA8uDYNSK0TVDsq3c125NWXTHPIRLb1I6O2BLdgR fwc81QkNO6MdX7HbNAyqO3elWnkW0RT4ESE1U9zLrs14AwAOfLDSXjHAzhKTYocluqR7 3OmDfqpX5xUmnzDtJhBNRit5mAztlHZ9q1Rb7nkNsCFF64zKnnkXH2860HL47DB51tr0 mdcTJaBtZgQ/pHvXJR4gg6GMIsuOqHgIgo9tViAQSfm7n2Qk0d+TPH7Hox/6dmVhtYJE fYPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=M3mE0KyM; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu19-20020a170906f29300b009303262b4ebsi12741581ejb.993.2023.03.24.03.33.13; Fri, 24 Mar 2023 03:33:37 -0700 (PDT) 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; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=M3mE0KyM; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231826AbjCXKaJ (ORCPT + 99 others); Fri, 24 Mar 2023 06:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231625AbjCXK3y (ORCPT ); Fri, 24 Mar 2023 06:29:54 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E885C131 for ; Fri, 24 Mar 2023 03:29:52 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32O4jujo024321; Fri, 24 Mar 2023 05:29:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=H3Al6fxftb4sYSq8AeR6Z82rHyYTeUIs6TxuWGnCgFc=; b=M3mE0KyMQ/lsqGR0YBSbUf8ZbXwxCaYCljMErDy720aMJUtOXprdfYYcPOE4O/i8J/t2 J6TW8AHVGLJ42a4bcXOha9xIaIcDvgJjC/vEDxuAR3ftHCGW5n/vePpOA2Y8UoB1GiM0 foIvASGLFpCfK4FP+mlqc6B0k4Is3Ka8fo1glfAgtcBtpqekiUiNIPD3J4P3Shw2jBrV 3AW4K5A4cD2SsXd8gRkUREtyV/az6FFGrUMKP/yizScwVZel3Ip2e4c0It4UD4KgTZcs pHJpRbs2mA2oXUAteTIkf45mKWvnT9Zv9KzffhoNl0Yre9KviStCgx+HoUvbeDmcmQkF IA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3pgy7drtsq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 05:29:17 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Fri, 24 Mar 2023 05:29:16 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Fri, 24 Mar 2023 05:29:16 -0500 Received: from [198.90.251.127] (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.127]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1381CB06; Fri, 24 Mar 2023 10:29:16 +0000 (UTC) Message-ID: Date: Fri, 24 Mar 2023 10:29:15 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] ASoC: cs35l56: Fix an unsigned comparison which can never be negative To: Jiapeng Chong , CC: , , , , , Abaci Robot References: <20230324022303.121485-1-jiapeng.chong@linux.alibaba.com> Content-Language: en-US From: Richard Fitzgerald In-Reply-To: <20230324022303.121485-1-jiapeng.chong@linux.alibaba.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: -kcnwc-THJq-5LmDGdDARbCNF7iboNym X-Proofpoint-GUID: -kcnwc-THJq-5LmDGdDARbCNF7iboNym X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 24/03/2023 02:23, Jiapeng Chong wrote: > The variable 'rv' is defined as unsigned type, so the following if > statement is invalid, we can modify the type of rv to int. > if (rv < 0) { > dev_err(cs35l56->dev, "irq: failed to get pm_runtime: > %d\n", rv); > goto err_unlock; > } > > ./sound/soc/codecs/cs35l56.c:333:5-7: WARNING: Unsigned expression compared with zero: rv < 0. > > Reported-by: Abaci Robot > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4599 > Signed-off-by: Jiapeng Chong > --- > sound/soc/codecs/cs35l56.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c > index 90fc79b5666d..d97b465f0d3c 100644 > --- a/sound/soc/codecs/cs35l56.c > +++ b/sound/soc/codecs/cs35l56.c > @@ -321,7 +321,9 @@ irqreturn_t cs35l56_irq(int irq, void *data) > struct cs35l56_private *cs35l56 = data; > unsigned int status1 = 0, status8 = 0, status20 = 0; > unsigned int mask1, mask8, mask20; > - unsigned int rv, val; > + unsigned int val; > + int rv; > + > irqreturn_t ret = IRQ_NONE; > > if (!cs35l56->init_done) Reviewed-by: Richard Fitzgerald