Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1237975rda; Mon, 23 Oct 2023 06:52:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESqB18jf+pGH+p9Fi/08JdV0IMCELnv65TpL6vOifEYdsArKFGKLlp6vzH6P+H9eq49lvh X-Received: by 2002:a17:90a:183:b0:27f:bd9e:5a15 with SMTP id 3-20020a17090a018300b0027fbd9e5a15mr860770pjc.28.1698069158734; Mon, 23 Oct 2023 06:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698069158; cv=none; d=google.com; s=arc-20160816; b=xhzGitFpGRfkdnxQAQreV6jb3HQIZF+4noA7klLXZEN/Xur+ONAlAPZa3rj6R9OD1L wp6kZuBy46u1WyFxQAPzDTnN1unjjRAEtKYpxRDr5sdaRBoGNvVPgB78HAnXOqUYR+aC HFztA40f6DaPgyUsyHOro16P9+RgVMHSr/1IJBk36iSUoNkJ6kUbecbLBolgtCa4jnvh zxN0jX0uJy20IhURFXnsW7n2Oy6WMUdKyF2ML63wDhajp5iXrcuXIKgTZvVMjZTwWjNQ omoVIp0/S1Mzg59GdlHOz0d3dF0OLs1aJDmBA4a409WTv2fMBqI0PrU9LJIErCFp6Zvh 4pDg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=s0TpdmHTB3TeAXcKViHpc82edgCX1hRxxfKIZo4nydo=; fh=tIKSG2jUjpHfNADglg028RRMA5HZcBQYKQ5aJcpn2dQ=; b=mLv6fSSKg5y9Pqn/U18ahvXZZUX6DdiU7lKDD4gqAkfZpPFL7TrS7raHm5nYmVgfc0 w+9yyZBUXB5fADgbyiiRj7cqgx1MauRwqJTHQEOaS1qChvKuBPMWLwL1mtO3zZ2hqD3G oElGBtuLunHW1nPlFX9SvCDBaHtbGZWOMrgEr9GWm4yJupjq5xwqnv5QL0l/WHwPLyoQ vSl+23Btpqw3/LNbUjzN+c+gBh+HfnDTcMkO/Lz2RStwb6qgMvV0POuM8chsYokmOSRM B71UUOdzLHErUyO+L4YYir1JW+O4cCdECW+1KgqJEMnWJrhjORnjiHgCjvRVenN892N6 fWhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id mh9-20020a17090b4ac900b0027763b64ea1si9676295pjb.44.2023.10.23.06.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:52:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 414AF807E441; Mon, 23 Oct 2023 06:52:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbjJWNwV (ORCPT + 99 others); Mon, 23 Oct 2023 09:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbjJWNwU (ORCPT ); Mon, 23 Oct 2023 09:52:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 89B0DE4; Mon, 23 Oct 2023 06:52:17 -0700 (PDT) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 06:52:36 -0700 (PDT) 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) ||