Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp456366rwl; Thu, 23 Mar 2023 19:26:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YHLpHBzWSwBvpiUc5eVr+nWBgz4yR3cZtBTfHedmBdF2ZV40vSKZJBu0G1HbP03oTYIVs/ X-Received: by 2002:a17:906:148b:b0:933:422b:5f5d with SMTP id x11-20020a170906148b00b00933422b5f5dmr1358644ejc.18.1679624782814; Thu, 23 Mar 2023 19:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679624782; cv=none; d=google.com; s=arc-20160816; b=GK6PdXq7C6Pf6i3cin10xTOkLl/fDOSidRj2Gglyo5ckElLLK8whyEuTam18T/dXHi 9G4wU0lJmkZFP8NmpvgNlK/rv0vXf8z26qtFOKfo6oQQe3XRu5jPfRoyxqqvkegeAz5R QgoEiFzc5ueYgET2UCO0j9aXBE/O/LqocdNpKV62gWvfgkN19Tnq+pm64IVpXSvkOwW8 leDULIjCkMbnhz2BIjJCEK2D2kLTp2DRl223FnYrNgkgU7VnsBI0IPcBDFwGZuMyJoYw lz3QVTxstl/q63kp9y969dSsK3jtumT87ikDt5evi721afxnklFqxwxebFptovaUkKYo gYZQ== 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=7udMt5bcXfu7BBPlintcPAMItrgBBmXce3kqgke5AnU=; b=WPWLSIOsL/1lkW7dodJoyINHdPdZobMBcuuzw34XXhvtkKaRRPcjGFJ+mF2vbuY9ik vj3W/3tVVgiqB3B9WoQ1LO30YKfCcsXJvZ0CJecu6kfu38Asf56OR0Fc/C0p367rn+5O ofZc36YVLDmVp1qERpv/t1u9AUq25vZENM2AN9fHZOLJ4rlUwq7TnpEsDEAjTEWB76sm QTh2UNa++CjWpEcpvO7a2HXfTw2Ttr8Sa+IVuwU2GDGDZsbNHkitUKnmWV4WsDaRnjtb Rz1znrMhUMCxy/XqVrJGPSwJBrENQjw9hi1dfEU+X+D9WEz20uEM6O8YNQsCUlYbhFYy KgMQ== 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 hr19-20020a1709073f9300b0093549a153f9si15052726ejc.912.2023.03.23.19.25.59; Thu, 23 Mar 2023 19:26:22 -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; 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 S231477AbjCXCXZ (ORCPT + 99 others); Thu, 23 Mar 2023 22:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbjCXCXY (ORCPT ); Thu, 23 Mar 2023 22:23:24 -0400 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C526AD39 for ; Thu, 23 Mar 2023 19:23:22 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VeVutzY_1679624587; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VeVutzY_1679624587) by smtp.aliyun-inc.com; Fri, 24 Mar 2023 10:23:18 +0800 From: Jiapeng Chong To: james.schulman@cirrus.com Cc: david.rhodes@cirrus.com, tanureal@opensource.cirrus.com, rf@opensource.cirrus.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] ASoC: cs35l56: Fix an unsigned comparison which can never be negative Date: Fri, 24 Mar 2023 10:23:03 +0800 Message-Id: <20230324022303.121485-1-jiapeng.chong@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=-8.0 required=5.0 tests=ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 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) -- 2.20.1.7.g153144c