spi: s3c64xx: fix timeout counters in flush_fifo

In the s3c64xx_flush_fifo() code, the loops counter is post-decremented
in the do { } while(test && loops--) condition. This means the loops is
left at the unsigned equivalent of -1 if the loop times out. The test
after will never pass as if tests for loops == 0.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Fixes: 230d42d422e7 ("spi: Add s3c64xx SPI Controller driver")
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20240924134009.116247-2-ben.dooks@codethink.co.uk
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by Ben Dooks and committed by Mark Brown 68a16708 162d9b5d

+2 -2
+2 -2
drivers/spi/spi-s3c64xx.c
··· 245 245 loops = msecs_to_loops(1); 246 246 do { 247 247 val = readl(regs + S3C64XX_SPI_STATUS); 248 - } while (TX_FIFO_LVL(val, sdd) && loops--); 248 + } while (TX_FIFO_LVL(val, sdd) && --loops); 249 249 250 250 if (loops == 0) 251 251 dev_warn(&sdd->pdev->dev, "Timed out flushing TX FIFO\n"); ··· 258 258 readl(regs + S3C64XX_SPI_RX_DATA); 259 259 else 260 260 break; 261 - } while (loops--); 261 + } while (--loops); 262 262 263 263 if (loops == 0) 264 264 dev_warn(&sdd->pdev->dev, "Timed out flushing RX FIFO\n");