From patchwork Fri Jan 6 01:17:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 39897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp582378wrt; Thu, 5 Jan 2023 17:33:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaG8HGdm0T78XJcLb08OTXT9TmrRQSBHVOdVq7eIdJ5XTuTHkQBCz0J0JMy5jlCeiNOcOa X-Received: by 2002:a17:90a:9606:b0:219:f7e5:cb56 with SMTP id v6-20020a17090a960600b00219f7e5cb56mr58900692pjo.20.1672968789932; Thu, 05 Jan 2023 17:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672968789; cv=none; d=google.com; s=arc-20160816; b=V5qdaLxkC8C3Z0GUGzKiud/ucaJFkaj7pKPfV/cpU/W9JfvHPvtKLYPI5klTDTd9hy KdVmCeMDAMsxcrPjmMg6VFJzawA7Pes7VN2v72XTQCHd0ONuzsk0PmTgPnEPVXPXhNY3 ZTt0i0p067m2e/y6rWG+F3BXKpHeOwFruGpkIuOwn0fpUclum2nHocaiCdq4tx52GnWw ce2XaBl/zOZzYkgHnSRUxRBkB9htejitszm6INhBX9u24vWIugPYdomAKnW0U1f7tuUr Xa9lzciw0ciCbXTew+HkDjFB/DG0omlrb8bcCfwIYQPY/8StzXI5QgeClUMzinZKh5Ox Ckqg== 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=tsJzTEX9q/H+yHh7jUKptoaeej0GuQk/oqDKu4yIsMw=; b=iNVfCVDfIL1Xb4ep9R83YW7NiCTH05rsOpHJYiG1CCZjyMIr2GIfFh5++uoQtRCCKy GsTsbUQIAbyZqOzUu4FjXXjki1kqogDufgu7qUICMKdSRGd8dNTQWwJ+WMtz1lpDyYj+ 7hc095ZxTRXncpwNiONL9ghxJ0Nh1TjZpdWapSLGJ0B1NLNzJm9JZqgccg1Xy8DqjMO/ 37htSduD8Ldr66eGwb6sm5BW/I12TBrE1eeNWLfG2DD169VvK0/Xh0efK1YSsE2DP/tf zJrBd3lh1aG4esCw4oSvChF8skTGL+Og2Qoe3jYRBY4GkUhS70RPf+cWIJpCHX+C/o4l t1PQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n30-20020a635c5e000000b00477c217a5eesi39400721pgm.317.2023.01.05.17.32.55; Thu, 05 Jan 2023 17:33:09 -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 S229554AbjAFBZv (ORCPT + 99 others); Thu, 5 Jan 2023 20:25:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjAFBZK (ORCPT ); Thu, 5 Jan 2023 20:25:10 -0500 Received: from out199-6.us.a.mail.aliyun.com (out199-6.us.a.mail.aliyun.com [47.90.199.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 261946FE1A; Thu, 5 Jan 2023 17:19:42 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VYxJXpw_1672967833; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VYxJXpw_1672967833) by smtp.aliyun-inc.com; Fri, 06 Jan 2023 09:17:14 +0800 From: Yang Li To: quic_schowdhu@quicinc.com Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] soc: qcom: dcc: Fix unsigned comparison with less than zero Date: Fri, 6 Jan 2023 09:17:10 +0800 Message-Id: <20230106011710.2827-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754234921801572894?= X-GMAIL-MSGID: =?utf-8?q?1754234921801572894?= The return value from the call to kstrtouint_from_user() is int. However, the return value is being assigned to an unsigned int variable 'ret', so making 'ret' an int. Eliminate the following warning: ./drivers/soc/qcom/dcc.c:815:5-8: WARNING: Unsigned expression compared with zero: ret < 0 Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3638 Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/soc/qcom/dcc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/dcc.c b/drivers/soc/qcom/dcc.c index d4101f79cb5d..5b50d638771d 100644 --- a/drivers/soc/qcom/dcc.c +++ b/drivers/soc/qcom/dcc.c @@ -808,7 +808,8 @@ static ssize_t config_reset_write(struct file *filp, const char __user *user_buf, size_t count, loff_t *ppos) { - unsigned int val, ret; + unsigned int val; + int ret; struct dcc_drvdata *drvdata = filp->private_data; ret = kstrtouint_from_user(user_buf, count, 0, &val);