From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EBE8CDB474 for ; Mon, 23 Oct 2023 13:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sghQ+QcNUtQOyRMxj5xQ/STOj4hDyioBDeuQAewRsHs=; b=bmSIaepn1LLrLn DvTjNYoUalVG2/8N5sa2q3Mebrzi37zaYuPQ9NJZ6QehazsoilWcLOajFG0YG5SC0Xt+f3tm51yMM O69zbxYIusS8KEGVAK8sVrm6SvutHFHE8liaZ+JwVCbCazpKXfJhXN4J3aVx7IzB/2+TQYSschJ6E AIQbueMO1jPrwenX3hEGXtEKZnj0Glx7zAI3ERUH0/pISylvPCc4EuyGERQidvygqR2jt9C2h/xRz B2kHmVK1wH7VcCRgjOFsa486cy+S5nZ1gkbehi9HNbJjA1TvBKLqMfUsxPMiyCF5CD/VlQxpPwXgB 3sr9yTDvAW/Weh9/cQ9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quvM1-007Tdh-2o; Mon, 23 Oct 2023 13:52:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quvLy-007TcY-02 for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 13:52:23 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 55F232F4; Mon, 23 Oct 2023 06:52:57 -0700 (PDT) Received: from donnerap.manchester.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCADE3F64C; Mon, 23 Oct 2023 06:52:14 -0700 (PDT) Date: Mon, 23 Oct 2023 14:52:11 +0100 From: Andre Przywara To: Colin Ian King Cc: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH][next] clk: sunxi-ng: nkm: remove redundant initialization of tmp_parent Message-ID: <20231023145211.4acaedda@donnerap.manchester.arm.com> In-Reply-To: <20231023133502.666559-1-colin.i.king@gmail.com> References: <20231023133502.666559-1-colin.i.king@gmail.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_065222_117703_36BF1F28 X-CRM114-Status: GOOD ( 16.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 23 Oct 2023 14:35:02 +0100 Colin Ian King wrote: Hi, > Variable tmp_parent is being ininitialized with a value that is never > read, the initialization is redundant and can be removed. Move the > initialization and move the variable to the inner loop scope. > > Signed-off-by: Colin Ian King Yes, that seems to be correct: Reviewed-by: Andre Przywara Cheers, Andre > --- > drivers/clk/sunxi-ng/ccu_nkm.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c > index eed64547ad42..853f84398e2b 100644 > --- a/drivers/clk/sunxi-ng/ccu_nkm.c > +++ b/drivers/clk/sunxi-ng/ccu_nkm.c > @@ -21,17 +21,16 @@ static unsigned long ccu_nkm_find_best_with_parent_adj(struct ccu_common *common > unsigned long *parent, unsigned long rate, > struct _ccu_nkm *nkm) > { > - unsigned long best_rate = 0, best_parent_rate = *parent, tmp_parent = *parent; > + unsigned long best_rate = 0, best_parent_rate = *parent; > unsigned long best_n = 0, best_k = 0, best_m = 0; > unsigned long _n, _k, _m; > > for (_k = nkm->min_k; _k <= nkm->max_k; _k++) { > for (_n = nkm->min_n; _n <= nkm->max_n; _n++) { > for (_m = nkm->min_m; _m <= nkm->max_m; _m++) { > - unsigned long tmp_rate; > + unsigned long tmp_rate, tmp_parent; > > tmp_parent = clk_hw_round_rate(parent_hw, rate * _m / (_n * _k)); > - > tmp_rate = tmp_parent * _n * _k / _m; > > if (ccu_is_better_rate(common, rate, tmp_rate, best_rate) || _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel