From patchwork Wed Jun 14 01:29:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 107651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp939457vqr; Tue, 13 Jun 2023 18:49:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4X49KgrBxCBFg9g4xUoMZJ/4VwwuLPP5VD7lW5uaAWfFyYBesbJGGszpbKSEA+ga1pMCIS X-Received: by 2002:a17:907:2d2c:b0:965:d18b:f03a with SMTP id gs44-20020a1709072d2c00b00965d18bf03amr15209965ejc.58.1686707346221; Tue, 13 Jun 2023 18:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686707346; cv=none; d=google.com; s=arc-20160816; b=BSuNPRRhJsHc4vp9kDAvjAivbrYBG2gI6xXTz8fkMgSn0cj95v218cWZQag9UmybVV J6RCepN2Meyk8VEg5rm1KsQTRwsGASESaAZsNNrex2/GS8IMG2qw/gXOT7L2Ofn/P+4U 8skVzT3J3lmBY1a0BDMaMh0znoE87mDXAsBhnCJbsZdg+XHkIMqz/aW5EaxVOZ+sZy1e 8b/UTwXwVB34lR+BFOkHmk5njKwnfJSE0zB0vs4W8ny6W3DfKm6YnES7XvjgOzJWiAdv OQ382rSD08y4rN3FQk2hcvWSFgneP7pXQrd5/JjiUQ+KgZWEPkBEUFeF+DxOVT74rxfS Hz/Q== 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=Pn919uAu8BiyJ1Xs2rf5InzIq9cbXsTDYl0MyGhPcjE=; b=T6xlOcI8eS2zMLyibHtseaSMqAsgHVwDHzIWYmTZ2G4fo0vuR5F8a7XIPy7S/Xa8dc hglU8xkChQ79VbqGdBNHmgytgKE7z1nKCMNkJdNxavyDDsg623Tg8O2kKReOg7rwZpA3 iofiAdLGBwP4bmFqPeAo2hkhCAUvjE1YoOc4ggOTDioels2XK4MYTGn0r76AqQQSXhz+ sVHUjt6Ko/YBOay8Qgb5cPEF0oQpDoUztTNZBWp/SGYFffNJabmsyLkvJPkbjmqoUJQb uC2k3EJvbexcTSiWGeWBjP8PxdCTpbTkpe09d3a2Gh7VqzgyGndnpDmABUNdhG3OdV4V 46tg== 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 z15-20020a170906814f00b0097397abcee3si7691925ejw.848.2023.06.13.18.48.42; Tue, 13 Jun 2023 18:49:06 -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 S241271AbjFNB31 (ORCPT + 99 others); Tue, 13 Jun 2023 21:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231229AbjFNB3W (ORCPT ); Tue, 13 Jun 2023 21:29:22 -0400 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E82CE57; Tue, 13 Jun 2023 18:29:21 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Vl4DoHI_1686706156; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Vl4DoHI_1686706156) by smtp.aliyun-inc.com; Wed, 14 Jun 2023 09:29:17 +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 2/3] clk: stm32: core: Fix unsigned comparison with less than zero Date: Wed, 14 Jun 2023 09:29:12 +0800 Message-Id: <20230614012913.122220-2-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?1768640842439103063?= X-GMAIL-MSGID: =?utf-8?q?1768640842439103063?= The return value of the divider_ro_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/stm32/clk-stm32-core.c:451:6-10: WARNING: Unsigned expression compared with zero: rate < 0 ./drivers/clk/stm32/clk-stm32-core.c:461: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/stm32/clk-stm32-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c index d5aa09e9fce4..067b918a8894 100644 --- a/drivers/clk/stm32/clk-stm32-core.c +++ b/drivers/clk/stm32/clk-stm32-core.c @@ -431,7 +431,7 @@ static int clk_stm32_composite_determine_rate(struct clk_hw *hw, { struct clk_stm32_composite *composite = to_clk_stm32_composite(hw); const struct stm32_div_cfg *divider; - unsigned long rate; + long rate; if (composite->div_id == NO_STM32_DIV) return 0;