Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2029519rwd; Tue, 13 Jun 2023 18:49:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Dxx8jRXKsJjCBNiVu/Nz2oD+govNYZgRYIxFOebkJsE+/6UZMLy1EUH4R4tNgV0iH5k8N X-Received: by 2002:a17:906:9b8d:b0:974:e755:9fde with SMTP id dd13-20020a1709069b8d00b00974e7559fdemr15281252ejc.19.1686707387946; Tue, 13 Jun 2023 18:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686707387; cv=none; d=google.com; s=arc-20160816; b=vwJmRlip/xUcL3OiRfNT8pP7r7YJg3uNb2PQhY4TCfyivkXvDLcCyHCbSRmv93d8aE KJIoG9s5KAqOCNBmOBcbnT14/bvI+uUY7bQX+stJBG9+462OUQ9ND7dq3y4vtNB92/mV pKm7blZZWZNOvqQDD+WJ2PcG3zovx3bwmqnCyKxgli1YKpB8LbYXyEZV8SFCqV9Vy5vQ JTKhqCulR7H9/Odnb5uTiFSD9LPGlwFSdswNra/FMbZ/s6upzxROzknMf2BQ37AMFyTE XC2QylSLXp47wOH8Z3GWqBDsThFfhCvmNjZHl+c7v3oocPm4dqnfBUVMQEcDVEBb9EIr JLQA== 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=RGVtEI2zmqOKhrQ7mbvkGpEswQvSZvkvX9McnVxL1CU=; b=Bogok0l9s0Ls1/rinF409E6HMHgbcrzI/zbvVyS2HIYrpYQl6cSYz+iiT4uMq3PD8k tUOjo2MHKcjbAomaJCJDCrAV+IxnuTFV15MUHrC6o3hdXVZptcjWVkV2E9vpC4mLTEe8 BTXoonQZcqcyi3VPk6/Dk9gLmEsSOrgGjnf9aFKfJUuhjCNfJOGAr1mkpkn36DMGeWzF W+y8fYmkYU8V8z/seOVJQX+JunaDA+O7xUHvVeLrwMESMGMj/6zhJtNkfMgsEpflROfm jMbjTXrLPHH7J/psL2ZrATY5+P59w8eykVSVzLb0hIbF8j2OD6lnPrMGZiKLEnx1mXK0 6hEA== 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 ov5-20020a170906fc0500b0096f5eeeda37si7486920ejb.903.2023.06.13.18.49.00; Tue, 13 Jun 2023 18:49:47 -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 S242139AbjFNBbG (ORCPT + 99 others); Tue, 13 Jun 2023 21:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232925AbjFNBa7 (ORCPT ); Tue, 13 Jun 2023 21:30:59 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AA6D1FD5; Tue, 13 Jun 2023 18:30:46 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R841e4;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=9;SR=0;TI=SMTPD_---0Vl4GQ6P_1686706236; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0Vl4GQ6P_1686706236) by smtp.aliyun-inc.com; Wed, 14 Jun 2023 09:30:43 +0800 From: Jiapeng Chong To: mturquette@baylibre.com Cc: sboyd@kernel.org, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] clk: sprd: composite: Fix unsigned comparison with less than zero Date: Wed, 14 Jun 2023 09:30:35 +0800 Message-Id: <20230614013035.123796-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=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED, 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 rate is defined as unsigned long type, if(rate<0) is invalid, modify to int type. drivers/clk/sprd/composite.c:20 sprd_comp_determine_rate() warn: unsigned 'rate' is never less than zero. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5520 Signed-off-by: Jiapeng Chong --- drivers/clk/sprd/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sprd/composite.c b/drivers/clk/sprd/composite.c index d3a852720c07..1c0390e8342e 100644 --- a/drivers/clk/sprd/composite.c +++ b/drivers/clk/sprd/composite.c @@ -13,7 +13,7 @@ static int sprd_comp_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { struct sprd_comp *cc = hw_to_sprd_comp(hw); - unsigned long rate; + int rate; rate = sprd_div_helper_round_rate(&cc->common, &cc->div, req->rate, &req->best_parent_rate); -- 2.20.1.7.g153144c