diff mbox series

[v2,06/14] spi: spi-meson-spicc: Remove set but never used variable 'data' from meson_spicc_reset_fifo()

Message ID 20200717135424.2442271-7-lee.jones@linaro.org
State Accepted
Commit d9b883aeaeb05d196244383ebe1bc52e39697948
Headers show
Series Rid W=1 warnings in SPI | expand

Commit Message

Lee Jones July 17, 2020, 1:54 p.m. UTC
Looks like it hasn't ever been checked.

Fixes the following W=1 kernel build warning(s):

 drivers/spi/spi-meson-spicc.c: In function ‘meson_spicc_reset_fifo’:
 drivers/spi/spi-meson-spicc.c:365:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable]
 365 | u32 data;
 | ^~~~

Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/spi/spi-meson-spicc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

-- 
2.25.1

Comments

Neil Armstrong July 21, 2020, 8:01 a.m. UTC | #1
On 17/07/2020 15:54, Lee Jones wrote:
> Looks like it hasn't ever been checked.

> 

> Fixes the following W=1 kernel build warning(s):

> 

>  drivers/spi/spi-meson-spicc.c: In function ‘meson_spicc_reset_fifo’:

>  drivers/spi/spi-meson-spicc.c:365:6: warning: variable ‘data’ set but not used [-Wunused-but-set-variable]

>  365 | u32 data;

>  | ^~~~

> 

> Cc: Kevin Hilman <khilman@baylibre.com>

> Cc: Neil Armstrong <narmstrong@baylibre.com>

> Cc: linux-amlogic@lists.infradead.org

> Signed-off-by: Lee Jones <lee.jones@linaro.org>

> ---

>  drivers/spi/spi-meson-spicc.c | 4 +---

>  1 file changed, 1 insertion(+), 3 deletions(-)

> 

> diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c

> index 77f7d0e0e46ad..ecba6b4a5d85d 100644

> --- a/drivers/spi/spi-meson-spicc.c

> +++ b/drivers/spi/spi-meson-spicc.c

> @@ -362,8 +362,6 @@ static void meson_spicc_setup_xfer(struct meson_spicc_device *spicc,

>  

>  static void meson_spicc_reset_fifo(struct meson_spicc_device *spicc)

>  {

> -	u32 data;

> -

>  	if (spicc->data->has_oen)

>  		writel_bits_relaxed(SPICC_ENH_MAIN_CLK_AO,

>  				    SPICC_ENH_MAIN_CLK_AO,

> @@ -373,7 +371,7 @@ static void meson_spicc_reset_fifo(struct meson_spicc_device *spicc)

>  			    spicc->base + SPICC_TESTREG);

>  

>  	while (meson_spicc_rxready(spicc))

> -		data = readl_relaxed(spicc->base + SPICC_RXDATA);

> +		readl_relaxed(spicc->base + SPICC_RXDATA);

>  

>  	if (spicc->data->has_oen)

>  		writel_bits_relaxed(SPICC_ENH_MAIN_CLK_AO, 0,

> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>
diff mbox series

Patch

diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
index 77f7d0e0e46ad..ecba6b4a5d85d 100644
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -362,8 +362,6 @@  static void meson_spicc_setup_xfer(struct meson_spicc_device *spicc,
 
 static void meson_spicc_reset_fifo(struct meson_spicc_device *spicc)
 {
-	u32 data;
-
 	if (spicc->data->has_oen)
 		writel_bits_relaxed(SPICC_ENH_MAIN_CLK_AO,
 				    SPICC_ENH_MAIN_CLK_AO,
@@ -373,7 +371,7 @@  static void meson_spicc_reset_fifo(struct meson_spicc_device *spicc)
 			    spicc->base + SPICC_TESTREG);
 
 	while (meson_spicc_rxready(spicc))
-		data = readl_relaxed(spicc->base + SPICC_RXDATA);
+		readl_relaxed(spicc->base + SPICC_RXDATA);
 
 	if (spicc->data->has_oen)
 		writel_bits_relaxed(SPICC_ENH_MAIN_CLK_AO, 0,