linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: Colin King <colin.king@canonical.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-clk@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] clk: socfpga: remove redundant initialization of variable div
Date: Tue, 6 Apr 2021 13:37:40 -0500	[thread overview]
Message-ID: <128f3972-d83a-6103-647e-d84f1ebfaa5c@kernel.org> (raw)
In-Reply-To: <20210406182746.432861-1-colin.king@canonical.com>



On 4/6/21 1:27 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable div is being initialized with a value that is
> never read and it is being updated later with a new value.  The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/clk/socfpga/clk-gate-s10.c | 2 +-
>   drivers/clk/socfpga/clk-pll-s10.c  | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/socfpga/clk-gate-s10.c b/drivers/clk/socfpga/clk-gate-s10.c
> index f9f403d7bb58..b84f2627551e 100644
> --- a/drivers/clk/socfpga/clk-gate-s10.c
> +++ b/drivers/clk/socfpga/clk-gate-s10.c
> @@ -31,7 +31,7 @@ static unsigned long socfpga_dbg_clk_recalc_rate(struct clk_hw *hwclk,
>   						  unsigned long parent_rate)
>   {
>   	struct socfpga_gate_clk *socfpgaclk = to_socfpga_gate_clk(hwclk);
> -	u32 div = 1, val;
> +	u32 div, val;
>   
>   	val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;
>   	val &= GENMASK(socfpgaclk->width - 1, 0);
> diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c
> index bc37461d43c0..70076a80149d 100644
> --- a/drivers/clk/socfpga/clk-pll-s10.c
> +++ b/drivers/clk/socfpga/clk-pll-s10.c
> @@ -107,7 +107,7 @@ static unsigned long clk_boot_clk_recalc_rate(struct clk_hw *hwclk,
>   					 unsigned long parent_rate)
>   {
>   	struct socfpga_pll *socfpgaclk = to_socfpga_clk(hwclk);
> -	u32 div = 1;
> +	u32 div;
>   
>   	div = ((readl(socfpgaclk->hw.reg) &
>   		SWCTRLBTCLKSEL_MASK) >>
> 

Acked-by: Dinh Nguyen <dinguyen@kernel.org>

  reply	other threads:[~2021-04-06 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 18:27 [PATCH][next] clk: socfpga: remove redundant initialization of variable div Colin King
2021-04-06 18:37 ` Dinh Nguyen [this message]
2021-04-07 23:30 ` Stephen Boyd

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=128f3972-d83a-6103-647e-d84f1ebfaa5c@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).