mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: linux-clk@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"kernel test robot" <lkp@intel.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Vladimir Zapolskiy" <vz@mleia.com>,
	"Joachim Eastwood" <manabian@gmail.com>
Subject: [PATCH v2 1/7] clk: nxp: Remove unused variable
Date: Sat,  5 Feb 2022 11:36:07 +0100	[thread overview]
Message-ID: <20220205103613.1216218-2-j.neuschaefer@gmx.net> (raw)
In-Reply-To: <20220205103613.1216218-1-j.neuschaefer@gmx.net>

GCC warns:

> ../drivers/clk/nxp/clk-lpc18xx-cgu.c: In function ‘lpc18xx_pll1_recalc_rate’:
> ../drivers/clk/nxp/clk-lpc18xx-cgu.c:460:13: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable]
>   460 |         u32 stat, ctrl;
>       |             ^~~~

Get rid of the (apparently) useless read from the PLL1_STAT register and
the declaration of stat.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: b04e0b8fd5443 ("clk: add lpc18xx cgu clk driver")
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

If the register read is actually useful because of a side-effect, please
speak up.


v2:
- New patch to address this warning
---
 drivers/clk/nxp/clk-lpc18xx-cgu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/nxp/clk-lpc18xx-cgu.c b/drivers/clk/nxp/clk-lpc18xx-cgu.c
index 8b686da5577b3..349eebf69ed93 100644
--- a/drivers/clk/nxp/clk-lpc18xx-cgu.c
+++ b/drivers/clk/nxp/clk-lpc18xx-cgu.c
@@ -457,9 +457,8 @@ static unsigned long lpc18xx_pll1_recalc_rate(struct clk_hw *hw,
 	struct lpc18xx_pll *pll = to_lpc_pll(hw);
 	u16 msel, nsel, psel;
 	bool direct, fbsel;
-	u32 stat, ctrl;
+	u32 ctrl;

-	stat = readl(pll->reg + LPC18XX_CGU_PLL1_STAT);
 	ctrl = readl(pll->reg + LPC18XX_CGU_PLL1_CTRL);

 	direct = (ctrl & LPC18XX_PLL1_CTRL_DIRECT) ? true : false;
--
2.34.1


  reply	other threads:[~2022-02-05 10:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05 10:36 [PATCH v2 0/7] clk: Declare mux tables as const u32[] Jonathan Neuschäfer
2022-02-05 10:36 ` Jonathan Neuschäfer [this message]
2022-02-26  1:00   ` [PATCH v2 1/7] clk: nxp: Remove unused variable Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 2/7] clk: nxp: Declare mux table parameter as const u32 * Jonathan Neuschäfer
2022-02-26  1:00   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 3/7] clk: mux: Declare u32 *table parameter as const Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 4/7] clk: hisilicon: Remove unnecessary cast of mux table to u32 * Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 5/7] clk: mmp: Declare mux tables as const u32[] Jonathan Neuschäfer
2022-02-26  1:01   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 6/7] clk: qcom: Declare mux table " Jonathan Neuschäfer
2022-02-26  1:02   ` Stephen Boyd
2022-02-05 10:36 ` [PATCH v2 7/7] clk: pistachio: " Jonathan Neuschäfer
2022-02-26  1:02   ` Stephen Boyd
2022-02-26  1:00 ` [PATCH v2 0/7] clk: Declare mux tables " Stephen Boyd
2022-02-26 12:40   ` Jonathan Neuschäfer
2022-03-12  2:33     ` 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=20220205103613.1216218-2-j.neuschaefer@gmx.net \
    --to=j.neuschaefer@gmx.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=manabian@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=vz@mleia.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®