[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D3QOCGDROG5A.361R73U5376FE@kernel.org>
Date: Tue, 27 Aug 2024 13:57:46 +0200
From: "Michael Walle" <mwalle@...nel.org>
To: "Yan Zhen" <yanzhen@...o.com>, <han.xu@....com>, <haibo.chen@....com>,
<broonie@...nel.org>
Cc: <yogeshgaur.83@...il.com>, <linux-spi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <opensource.kernel@...o.com>
Subject: Re: [PATCH v1] spi: nxp-fspi: Use min macro
Hi,
On Tue Aug 27, 2024 at 10:57 AM CEST, Yan Zhen wrote:
> 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.
The subject doesn't match what you're doing here. Also, shouldn't
one use max_t()?
-michael
>
> Signed-off-by: Yan Zhen <yanzhen@...o.com>
> ---
> drivers/spi/spi-nxp-fspi.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index 88397f712a3b..fda902aa5815 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(len, NXP_FSPI_MIN_IOMAP);
>
> f->ahb_addr = ioremap(f->memmap_phy + f->memmap_start,
> f->memmap_len);
Download attachment "signature.asc" of type "application/pgp-signature" (298 bytes)
Powered by blists - more mailing lists