[1/2] spi: omap-100k: Remove set but not used variable 'dataH'
diff mbox series

Message ID 1570523497-112804-2-git-send-email-zhengbin13@huawei.com
State Superseded
Headers show
Series
  • spi: Remove two set but not used variables
Related show

Commit Message

zhengbin (A) Oct. 8, 2019, 8:31 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/spi/spi-omap-100k.c: In function spi100k_read_data:
drivers/spi/spi-omap-100k.c:140:6: warning: variable dataH set but not used [-Wunused-but-set-variable]

It is not used since commit 35c9049b2704 ("Add OMAP spi100k driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/spi/spi-omap-100k.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.7.4

Comments

Geert Uytterhoeven Oct. 8, 2019, 9 a.m. UTC | #1
Hi Zhengbin,

On Tue, Oct 8, 2019 at 10:25 AM zhengbin <zhengbin13@huawei.com> wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/spi/spi-omap-100k.c: In function spi100k_read_data:
> drivers/spi/spi-omap-100k.c:140:6: warning: variable dataH set but not used [-Wunused-but-set-variable]
>
> It is not used since commit 35c9049b2704 ("Add OMAP spi100k driver")
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Have you tested this on actual hardware?
Are you sure the hardware does not require reading this register to work
properly?

> --- a/drivers/spi/spi-omap-100k.c
> +++ b/drivers/spi/spi-omap-100k.c
> @@ -128,7 +128,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
>
>  static int spi100k_read_data(struct spi_master *master, int len)
>  {
> -       int dataH, dataL;
> +       int dataL;
>         struct omap1_spi100k *spi100k = spi_master_get_devdata(master);
>
>         /* Always do at least 16 bits */
> @@ -146,7 +146,6 @@ static int spi100k_read_data(struct spi_master *master, int len)
>         udelay(1000);
>
>         dataL = readw(spi100k->base + SPI_RX_LSB);
> -       dataH = readw(spi100k->base + SPI_RX_MSB);
>         spi100k_disable_clock(master);
>
>         return dataL;

Gr{oetje,eeting}s,

                        Geert

Patch
diff mbox series

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index b955ca8..18b7d4b 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -128,7 +128,7 @@  static void spi100k_write_data(struct spi_master *master, int len, int data)

 static int spi100k_read_data(struct spi_master *master, int len)
 {
-	int dataH, dataL;
+	int dataL;
 	struct omap1_spi100k *spi100k = spi_master_get_devdata(master);

 	/* Always do at least 16 bits */
@@ -146,7 +146,6 @@  static int spi100k_read_data(struct spi_master *master, int len)
 	udelay(1000);

 	dataL = readw(spi100k->base + SPI_RX_LSB);
-	dataH = readw(spi100k->base + SPI_RX_MSB);
 	spi100k_disable_clock(master);

 	return dataL;