Re: [PATCH] staging: mt7621-spi: Fix Coding style issues reported by checkpatch.pl.

From: Joe Perches
Date: Thu May 31 2018 - 18:16:54 EST


On Fri, 2018-06-01 at 00:25 +0530, Sankalp Negi wrote:
> diff --git a/drivers/staging/mt7621-spi/spi-mt7621.c b/drivers/staging/mt7621-spi/spi-mt7621.c
[]
> @@ -164,9 +165,8 @@ static inline int mt7621_spi_wait_till_ready(struct spi_device *spi)
> u32 status;
>
> status = mt7621_spi_read(rs, MT7621_SPI_TRANS);
> - if ((status & SPITRANS_BUSY) == 0) {
> + if ((status & SPITRANS_BUSY) == 0)
> return 0;
> - }
> cpu_relax();
> udelay(1);
> }

It might also be more readable to avoid a status temporary
and use a direct compare instead:

for (i = 0; i < RALINK_SPI_WAIT_MAX_LOOP; i++) {
if (!(mt7621_spi_read(rs, MT7621_SPI_TRANS) & SPITRANS_BUSY))
return 0;
cpu_relax();
udelay(1);
}

return -ETIMEDOUT;
}