From patchwork Wed Jun 14 01:29:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 107647 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp937810vqr; Tue, 13 Jun 2023 18:44:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60kbaOSqbFzZp0OWCBaG/29Aj5BDfkEt2fdqWyU5Qo9QRkh+hkskHW/j8BVxZSmtj4/CUn X-Received: by 2002:a17:903:234f:b0:1ac:921c:87fc with SMTP id c15-20020a170903234f00b001ac921c87fcmr11479066plh.32.1686707052603; Tue, 13 Jun 2023 18:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686707052; cv=none; d=google.com; s=arc-20160816; b=m7T6Q/ev1TlBIwXOjkqKpPnwCOs1G+q+KWJ6dTX8Dk3WT7OAW+5t76W5akyHT8JdaA X0A5m8ZtGFEjAC6Z49HIjXo52YAQhjmyAPClEdsbrZHGwydlF71ToMm4ATqQNlD0+fIH 3m0RkU6VdvW8sTjcTfXA2WMk4+CLWiet1O5wUxfqdLHZKMYDCFxRwrdG0jDQjTXtxjEy wmLWBFsZpDESaAzDjBzd5XYXLqHCm61zsvEBHDniAq6ubqy7Cdz9ySxHFRp+XFEu0RIy u4KJxvUU81RU3zeZqcRNKh7Xmt2tV6fpD4cgTdioNH8sBy9fA9Xsa/ikCyHZGBpUBv/r ozoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ETBSV0/UHdLFsdDhYMKRZeCPYg8FnDD4P/Ty1csbISs=; b=TkfxivDKv5ROR8Js6plDJJuAqFux5t68CDczKnZxpZ+OxexMiTd+qMcFfM53smUU4g hR7uacvmOLufDZR7jlOttEtEsdruybMA6dEmLhcf3O9+g7zqxhIV8hNY60llYOHt9rmV 7TrowhV+lWhJhop3aYp/6xYdZu/55gthqG2endxo0ag9bP0D6QqrzDL5beJxOE2cVp0i xTocoyQKbD/vx0KQLzjTi+JSWEDApBxNLuctQlHopETMGUJ4v/J7Ggc2LEQ0CYT/9azL 1HsjV6qtiuW0oIVCrtCvzZMHXju3bpS4AKGa/M7UWBaaOBI3/aMxGWaPMzPwd3gqffFu Aj6w== 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 lk5-20020a17090308c500b001aad9b73ff2si9654594plb.285.2023.06.13.18.44.00; Tue, 13 Jun 2023 18:44:12 -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 S241535AbjFNB3f (ORCPT + 99 others); Tue, 13 Jun 2023 21:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240835AbjFNB3Z (ORCPT ); Tue, 13 Jun 2023 21:29:25 -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 B33F4B8; Tue, 13 Jun 2023 18:29:23 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R931e4;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=13;SR=0;TI=SMTPD_---0Vl4DoIc_1686706158; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Vl4DoIc_1686706158) by smtp.aliyun-inc.com; Wed, 14 Jun 2023 09:29:19 +0800 From: Yang Li To: sboyd@kernel.org Cc: mturquette@baylibre.com, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next 3/3] clk: tegra: Fix unsigned comparison with less than zero Date: Wed, 14 Jun 2023 09:29:13 +0800 Message-Id: <20230614012913.122220-3-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c In-Reply-To: <20230614012913.122220-1-yang.lee@linux.alibaba.com> References: <20230614012913.122220-1-yang.lee@linux.alibaba.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768640534440738211?= X-GMAIL-MSGID: =?utf-8?q?1768640534440738211?= The return value of the round_rate() is long. However, the return value is being assigned to an unsigned long variable 'rate', so making 'rate' to long. silence the warnings: ./drivers/clk/tegra/clk-periph.c:59:5-9: WARNING: Unsigned expression compared with zero: rate < 0 ./drivers/clk/tegra/clk-super.c:156:5-9: WARNING: Unsigned expression compared with zero: rate < 0 Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5519 Signed-off-by: Yang Li --- drivers/clk/tegra/clk-periph.c | 2 +- drivers/clk/tegra/clk-super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c index 0626650a7011..9eaac49facd4 100644 --- a/drivers/clk/tegra/clk-periph.c +++ b/drivers/clk/tegra/clk-periph.c @@ -51,7 +51,7 @@ static int clk_periph_determine_rate(struct clk_hw *hw, struct tegra_clk_periph *periph = to_clk_periph(hw); const struct clk_ops *div_ops = periph->div_ops; struct clk_hw *div_hw = &periph->divider.hw; - unsigned long rate; + long rate; __clk_hw_set_clk(div_hw, hw); diff --git a/drivers/clk/tegra/clk-super.c b/drivers/clk/tegra/clk-super.c index 7ec47942720c..7a121de526c0 100644 --- a/drivers/clk/tegra/clk-super.c +++ b/drivers/clk/tegra/clk-super.c @@ -147,7 +147,7 @@ static int clk_super_determine_rate(struct clk_hw *hw, { struct tegra_clk_super_mux *super = to_clk_super_mux(hw); struct clk_hw *div_hw = &super->frac_div.hw; - unsigned long rate; + long rate; __clk_hw_set_clk(div_hw, hw);