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 41FCDC25B45 for ; Mon, 23 Oct 2023 21:29:02 +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:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tzDt2D+f4HKVqlHTESqHxcizE0TDRaQrbE66g5vSKzo=; b=iw2jkpbhhHE/Wj Tjvne/0M3IZvLJgJKzXGpt+Hyc062ISQ2EceTUTkZPNyqXn4Uq+m9wzu5sGEIdBcYzabMw0ilrxle cG+nG5DS6qvv7b6fPOVNuPVZ/3DBgVi4H7g0R+pSsAIa6umSaiHyaqNZEKlg9BoeRM8Z17afQTOLF CntFXEQv8gKkXMDyLocU9bEypc5FRZZ4ZosJfPPTls9tFzgwECRy6A/2kmpiJgY/zGDXxX4NS8T6R sPDClApurNw2PB+aA5zpISy9GT76S10iBioxgYNd33v6ON1MmR3SVP+nMgIqrAuMSotMcOCltmHEl UP+eJZNGcpdZOlkin3og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qv2TV-008JPf-0n; Mon, 23 Oct 2023 21:28:37 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qv2TS-008JPH-2Y for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 21:28:36 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bfed7c4e6dso56420171fa.1 for ; Mon, 23 Oct 2023 14:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698096512; x=1698701312; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/i5l9FjisPDPcqgMEOco4v6QQottzWN3f7xhyjrsuPE=; b=ew7tzNcrOcalkbatWDFH/2XlZv+Sa1VLPlhMet6nNPddVqfMFZmVNxPAD7zpddwzW5 kLLfHai68FfqpmjB6h8E0UYWk5rHqy5rwiRB9DsdTF+0vfBHPtL/0g8hfMktWvdNMynw 2nj/9S7bFyoSUfupAs0ryNVen1DZNVgwk4y+GIs1/HSvC4ZqPq8bdLIz6HmMRiyqTsbp QMn+8Amwp3qATgtUwTBnyApjt2uiNG36RF0FyZ7wxdcGvNvBA3WXYnysyjhes7ZDh3GF iAgDvpFLGemvZGwh7k7smAQitSPfVGAhVNqYAMlutavhrc2MLTks93hS2Qy40s//XFBg gpYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698096512; x=1698701312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/i5l9FjisPDPcqgMEOco4v6QQottzWN3f7xhyjrsuPE=; b=RITy9bYz4Kg/I91CesoiisUL1bJUF2LbwsHB04hTvk+kI3HVoKuK/KuF8QyOvF+ZL0 d+ksOC8V4o+TYsOUGWce8g/3FzQ4aQQscHyjTusuGkj1ZstIbAkYG7oyfmoJWq2pZ6SF ZXHSD40lh6A6OKacgaqDbMD+3CnQIIDDzVGP+PN1yy6TGk5SL5Vvqva1rmwZlOd6Chh1 UOFeah3Tq02gQ+88kpX1bB26Etj36Xzebq3PdLQopEUOaEgKT4Qm5XjDIKvakw7IULol h09cCJnXpAiC6bf7wyfAY/AAj731dJ+mBeeiXn+BhC8cSnRUtHuupyrPJDJizg478E7+ awnQ== X-Gm-Message-State: AOJu0YyD4Kc9fiOlly6hxpYJXa3xTlHPfGSgR/FtUV5TR3BYoJGMTfaX NxDns35UMHgDbrQwuJgxyAs= X-Google-Smtp-Source: AGHT+IEf+hJBpR5SXhMS3VVLSjHNP/1//4tt9MjRaPhH6/m5DlgNbmQlN9gKwgp6ApxZyeAQlMzb+A== X-Received: by 2002:a05:651c:2112:b0:2c5:1490:1687 with SMTP id a18-20020a05651c211200b002c514901687mr8100017ljq.33.1698096511675; Mon, 23 Oct 2023 14:28:31 -0700 (PDT) Received: from jernej-laptop.localnet (82-149-12-148.dynamic.telemach.net. [82.149.12.148]) by smtp.gmail.com with ESMTPSA id bh9-20020a05600c3d0900b003feae747ff2sm15256302wmb.35.2023.10.23.14.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 14:28:31 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Samuel Holland , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Colin Ian King Cc: kernel-janitors@vger.kernel.org Subject: Re: [PATCH][next] clk: sunxi-ng: nkm: remove redundant initialization of tmp_parent Date: Mon, 23 Oct 2023 23:28:29 +0200 Message-ID: <2924841.e9J7NaK4W3@jernej-laptop> In-Reply-To: <20231023133502.666559-1-colin.i.king@gmail.com> References: <20231023133502.666559-1-colin.i.king@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_142834_836245_427B71C3 X-CRM114-Status: GOOD ( 15.98 ) 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 Dne ponedeljek, 23. oktober 2023 ob 15:35:02 CEST je Colin Ian King napisal(a): > 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 Reviewed-by: Jernej Skrabec Best regards, Jernej > --- > 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