diff options
author | Yan Zhen <yanzhen@vivo.com> | 2024-08-27 21:12:03 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-08-29 13:02:07 +0100 |
commit | 3959d1f0f8d6682aa896a8f78a9f5ebfd2b6f6c8 (patch) | |
tree | 363f4ddf0d7607f845f1489135d0af6adeeb700b /drivers/spi | |
parent | ab3f6e159204864f2bc208599d4652d10a4824ac (diff) | |
download | lwn-3959d1f0f8d6682aa896a8f78a9f5ebfd2b6f6c8.tar.gz lwn-3959d1f0f8d6682aa896a8f78a9f5ebfd2b6f6c8.zip |
spi: nxp-fspi: Use max macro
When the original file is guaranteed to contain the minmax.h header file
and compile correctly, using the real macro is usually
more intuitive and readable.
Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Link: https://patch.msgid.link/20240827131203.3918516-1-yanzhen@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-nxp-fspi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 88397f712a3b..fd1816befcd8 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -756,8 +756,7 @@ static int nxp_fspi_read_ahb(struct nxp_fspi *f, const struct spi_mem_op *op) iounmap(f->ahb_addr); f->memmap_start = start; - f->memmap_len = len > NXP_FSPI_MIN_IOMAP ? - len : NXP_FSPI_MIN_IOMAP; + f->memmap_len = max_t(u32, len, NXP_FSPI_MIN_IOMAP); f->ahb_addr = ioremap(f->memmap_phy + f->memmap_start, f->memmap_len); |