From patchwork Mon Oct 23 13:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 13432865 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 41F79C00A8F for ; Mon, 23 Oct 2023 13:35:41 +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: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:In-Reply-To:References: List-Owner; bh=UmZGH2BD0n1ldgcBpOQeT5Sj1NzP4Y7sfbo7ozf7heg=; b=XvL2igf3EVgk3M uVIN2Un7ZSUEd8+81d3C/3Wn/34k4SgMF9PKyaKweIIr7rgkzfPyq4/9DiZM7qcyx+KpRR0LBiHMB 7fKHSaKQ0aYGw0tMT4V4wV3yzJCtD1Pn4gXqWdvYnEhOY2jBZBEEBDHD05I9JptIaGRHYD2LU+rPu dRwStZM+AYBPREoQBklv/ceJ0aMQc5Y1ZAMWg190NL9Syo2qKwV/9vJNhn9vPAy2Iw/M+F3yDe+Xn tqGch9q7WB5UMjwyoepNDntwzAEgZhZR1n6BeqPI9wuIyqJbbP2God5Q/MCpACgvUmwO3qJXg6fXT 2cYZ6r+JSvfR/nvc6FRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quv5M-007SA4-2V; Mon, 23 Oct 2023 13:35:12 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1quv5K-007S8d-09 for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 13:35:11 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c509f2c46cso47039151fa.1 for ; Mon, 23 Oct 2023 06:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698068103; x=1698672903; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Wx0BrSEgwwqDaJo2A/cSmzYDiAma8W23poMJduSA6Ow=; b=ZorL38L3+q6e52PluzWWOtOxBZkEdpqHBOtCI1OleMe6SKM+5FAvLn0YzBnM2e3e7I ZvZi+plfqd3OcIYczyQWOmclE3L6GUsWEb2UKXpFvIundx7OEvigMAiSkVwwPICFWXgC jK9sWpQYgr2nEFKiB8CtfHB1QbtY3yLLtaNWE/3n2JnaDiFFqa62nhFITQwymCQ9NDJs Z8nRKzq5CJFPfj/3e4uqMlCWLjCRT2+FNJpcdF5o+qOy0vGa4kALb1KnCuakyPQBTukF sShndsD/SIiVq+cxQGdPu1yElv0P+HkwMnYY+dSziMt8FS6XS3t5FvntKmCW8E9dhUZq B6ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698068103; x=1698672903; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wx0BrSEgwwqDaJo2A/cSmzYDiAma8W23poMJduSA6Ow=; b=DF6QgBXcFvwGNszgCgaiO4Acl1vfYpxNSVUL8Tr9YCNJfqQ9leFS4DM320dXpEi1Mh 5lC57OAyYC6900p+Sljs8dSs5bvEJFHtgMrAzHprN5Vc+7WpLPnNEcqK0V0r+YSq3uS1 qF8hunzhLpAShM3bCB59WQBzCKrRDDYPqoot3K700toLIiDzRkOpsLlc0GUk5ulChY6u A32y68QhF9EXc8wdwEPuEOZU32b/dyVlf9R13w9YBcL8vcFiGe4csxdKIyU2UdkkvKkO xF1RvnLmBl7oWyrSW4rKJTm8/6lBMQKBKM+OzuMMp0p7Y87YI014+MbVndlG3cYfNouX unMA== X-Gm-Message-State: AOJu0Yz6o85jC/+Y6IpuS2dZ0qXgyXxpkovJt0vWkeqasohDPyuyL6IQ UMXwbushuyrCfL9bk3a0koQ= X-Google-Smtp-Source: AGHT+IF6iFCOYLHVJ673/GenbGT2JYzGsYEv1qorObhiXC5W33ZMltiL1xwut1ShRpGUTtslY+tkdw== X-Received: by 2002:a2e:9f50:0:b0:2bc:f39b:d1a8 with SMTP id v16-20020a2e9f50000000b002bcf39bd1a8mr5834000ljk.46.1698068103373; Mon, 23 Oct 2023 06:35:03 -0700 (PDT) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id m29-20020a05600c3b1d00b003fe61c33df5sm14469380wms.3.2023.10.23.06.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:35:02 -0700 (PDT) From: Colin Ian King To: 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 Cc: kernel-janitors@vger.kernel.org Subject: [PATCH][next] clk: sunxi-ng: nkm: remove redundant initialization of tmp_parent Date: Mon, 23 Oct 2023 14:35:02 +0100 Message-Id: <20231023133502.666559-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_063510_091832_39FD587D X-CRM114-Status: GOOD ( 12.57 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: Andre Przywara Reviewed-by: Jernej Skrabec --- 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) ||