mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.i.king@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] net: microchip: sparx5: remove redundant store to variable clk_hz
Date: Tue, 16 Jan 2024 16:18:47 +0000	[thread overview]
Message-ID: <20240116161847.2317011-1-colin.i.king@gmail.com> (raw)

The store to clk_hz is redundant since clk_hz goes out of scope on the
return. Fix this by replacing the *= operator with just * to remove
the store back to clk_hz.

Cleans up clang scan build warning:
warning: Although the value stored to 'clk_hz' is used in the enclosing
expression, the value is never actually read from 'clk_hz'
[deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c b/drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c
index f5267218caeb..d8f49082dbe4 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c
@@ -31,7 +31,7 @@ int sparx5_sdlb_clk_hz_get(struct sparx5 *sparx5)
 		clk_per_100ps = SPX5_CLK_PER_100PS_DEFAULT;
 
 	clk_hz = (10 * 1000 * 1000) / clk_per_100ps;
-	return clk_hz *= 1000;
+	return clk_hz * 1000;
 }
 
 static int sparx5_sdlb_pup_interval_get(struct sparx5 *sparx5, u32 max_token,
-- 
2.39.2


             reply	other threads:[~2024-01-16 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 16:18 Colin Ian King [this message]
2024-01-17  1:53 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116161847.2317011-1-colin.i.king@gmail.com \
    --to=colin.i.king@gmail.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®