]> www.infradead.org Git - linux.git/commitdiff
spi: nxp-fspi: Use max macro
authorYan Zhen <yanzhen@vivo.com>
Tue, 27 Aug 2024 13:12:03 +0000 (21:12 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 29 Aug 2024 12:02:07 +0000 (13:02 +0100)
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>
drivers/spi/spi-nxp-fspi.c

index 88397f712a3b5e70c6111e8dce8438babcbe92a0..fd1816befcd8d198b43af1cb1900dcc42fd6a82b 100644 (file)
@@ -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);