diff options
| author | Carlos Song <carlos.song@nxp.com> | 2025-12-10 13:50:01 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-12-14 13:39:29 +0300 |
| commit | b884e34994ca41f7b7819f3c41b78ff494787b27 (patch) | |
| tree | ca923869f83aeb6da0506b331b54e4bc45fc5376 | |
| parent | e6268db46c173b18e5b2f4fc0c8a5c0aaaee61ea (diff) | |
| download | linux-b884e34994ca41f7b7819f3c41b78ff494787b27.tar.xz | |
spi: spi-fsl-lpspi: convert min_t() to simple min()
Current min() has supported comparison by normal integer promotion rules,
so explicit type casts or min_t() are not needed.
Signed-off-by: Carlos Song <carlos.song@nxp.com>
Reviewed-by: David Laight <david.laight.linux@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251210105001.3891776-1-carlos.song@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-fsl-lpspi.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 065456aba2ae..8f45ead23836 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -486,15 +486,7 @@ static int fsl_lpspi_setup_transfer(struct spi_controller *controller, fsl_lpspi->tx = fsl_lpspi_buf_tx_u32; } - /* - * t->len is 'unsigned' and txfifosize and watermrk is 'u8', force - * type cast is inevitable. When len > 255, len will be truncated in min_t(), - * it caused wrong watermark set. 'unsigned int' is as the designated type - * for min_t() to avoid truncation. - */ - fsl_lpspi->watermark = min_t(unsigned int, - fsl_lpspi->txfifosize, - t->len); + fsl_lpspi->watermark = min(fsl_lpspi->txfifosize, t->len); if (fsl_lpspi_can_dma(controller, spi, t)) fsl_lpspi->usedma = true; |
