lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220205103613.1216218-2-j.neuschaefer@gmx.net>
Date:   Sat,  5 Feb 2022 11:36:07 +0100
From:   Jonathan Neuschäfer <j.neuschaefer@....net>
To:     linux-clk@...r.kernel.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Jonathan Neuschäfer <j.neuschaefer@....net>,
        kernel test robot <lkp@...el.com>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Vladimir Zapolskiy <vz@...ia.com>,
        Joachim Eastwood <manabian@...il.com>
Subject: [PATCH v2 1/7] clk: nxp: Remove unused variable

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@...el.com>
Fixes: b04e0b8fd5443 ("clk: add lpc18xx cgu clk driver")
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ