From patchwork Mon Feb 27 10:59:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 61920 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2350610wrd; Mon, 27 Feb 2023 03:04:46 -0800 (PST) X-Google-Smtp-Source: AK7set/lov6VH43NOchrH7Is3kSycumThOU0xg6PmegsTe2rHHkM3aHPWrv59eMZbIU9jujpIEyQ X-Received: by 2002:a17:906:5d0f:b0:8f0:143d:ee28 with SMTP id g15-20020a1709065d0f00b008f0143dee28mr19850093ejt.16.1677495886184; Mon, 27 Feb 2023 03:04:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677495886; cv=none; d=google.com; s=arc-20160816; b=uG+VOFZoCZPxLwRnce9uToHxhL96wjUzmbm19WuxY+f//r6OzUPmUyzOyWbHcMHA+4 0KX0uxP4Zz9SawWfz2j2ZX+QhqoPl9ix1OGHlCzLgeJoCxUvl3F5Xkm+bvWK78iXeCgH AY2+cN1Kohw/b3go+qbf9gRP3nMYHYIwYUneD6ecbxoGzTp4EMEp6cvFTDslZhvvekSO c9V+pU7jcWMI66D9LUG6zpkEGe9VaGhWMCsL7qqq94FFCdsBgmk8c76SbP5iNeSkEYXz 4MxrESNdpLkjIE5UWSUVJCCcxPX/yYvDTkLKhHj/NmuzN3ZEEs2AHLIlRZFRQylo2mJe HuWQ== 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:dkim-signature; bh=32AsuYUQ4sPTfiv/QiHVM+q71FXAbnwn/2QyE9HZaSg=; b=Kq/FvJHSIWs2Lhqj0Fmm8cSK0aj1eR4topjehhAGsm6yd42MGPqAwFLL8MmERTuWEr UTg5KNJ45niWrp2CiyTxEHAWr1ohl06zWWlitH4FCHTwIceNxiBvuviLurP1OrmyCxKg FGYUUeZ6eSyXFnxmI4DOSdx1/mEB0TXts7JaRALI02imH3+IepYzkIA3xU5Ac5T/LmVV bLBR29yGFn7PHPIyyVIrrpXjwXxM7qLMYp5opbPUnrlbXBojJkpzPBPRMOd9rBidAa7D ZG9bTtBrJbV7K4mlnzNjloV3pF6e1nYVIfP4I64REHDGi1WStgi2bMPj771QzKfSuMp0 W7dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=m9hlkbOw; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb18-20020a170907961200b008ce1317f9a3si10084363ejc.280.2023.02.27.03.04.23; Mon, 27 Feb 2023 03:04:46 -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; dkim=pass header.i=@microchip.com header.s=mchp header.b=m9hlkbOw; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbjB0LCx (ORCPT + 99 others); Mon, 27 Feb 2023 06:02:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjB0LCg (ORCPT ); Mon, 27 Feb 2023 06:02:36 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9978B20D22; Mon, 27 Feb 2023 03:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677495718; x=1709031718; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DCAwh44v3dpEcmwP85zem/AILU4rZ+BTE1TOGKnxNQw=; b=m9hlkbOwn0bhcxRakY8duxyoOuOMcJqILhX/Jk5TixIAvD6QuuGENiBb yUUZaiEC4qcTrUcA46gyyBfiLHtkhcLLDPmkCnD1j9rbKwzjpu6o1mALl rk6EwR0mp6ZuB5oMtnyrDd7uyjs2MrbDNcxo6+OftqrB+cvimQFgAxhCT TOU8DSmiGZQGDNckz3qszzeVX7H+DDtblAixozbnXEXZKYqBuoiI/SjR8 FMMUNPY/xX7F2ChA373iUZn38uDS/ZldHWvWFC7Dm7zD6YAqnY8Qw1ie2 OFP7jAsZNu6bJwXv+yDXmDlAssn/sbnPV8WsMi6MoJkXJuPLh87ZWIBgB Q==; X-IronPort-AV: E=Sophos;i="5.97,331,1669100400"; d="scan'208";a="202692672" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Feb 2023 03:59:43 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 27 Feb 2023 03:59:40 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 27 Feb 2023 03:59:38 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea , Dan Carpenter Subject: [PATCH] clk: at91: clk-sam9x60-pll: fix return value check Date: Mon, 27 Feb 2023 12:59:31 +0200 Message-ID: <20230227105931.2812412-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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?1758981925990912884?= X-GMAIL-MSGID: =?utf-8?q?1758981925990912884?= sam9x60_frac_pll_compute_mul_frac() can't return zero. Remove the check against zero to reflect this. Fixes: 43b1bb4a9b3e ("clk: at91: clk-sam9x60-pll: re-factor to support plls with multiple outputs") Reported-by: Dan Carpenter Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-sam9x60-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c index d757003004cb..0882ed01d5c2 100644 --- a/drivers/clk/at91/clk-sam9x60-pll.c +++ b/drivers/clk/at91/clk-sam9x60-pll.c @@ -668,7 +668,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN, parent_rate, true); - if (ret <= 0) { + if (ret < 0) { hw = ERR_PTR(ret); goto free; }