The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Yan Zhen" <yanzhen@vivo.com>, <han.xu@nxp.com>,
	<haibo.chen@nxp.com>, <broonie@kernel.org>
Cc: <yogeshgaur.83@gmail.com>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <opensource.kernel@vivo.com>
Subject: Re: [PATCH v1] spi: nxp-fspi: Use min macro
Date: Tue, 27 Aug 2024 13:57:46 +0200	[thread overview]
Message-ID: <D3QOCGDROG5A.361R73U5376FE@kernel.org> (raw)
In-Reply-To: <20240827085739.3817877-1-yanzhen@vivo.com>

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

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@vivo.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);


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  parent reply	other threads:[~2024-08-27 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  8:57 [PATCH v1] spi: nxp-fspi: Use min macro Yan Zhen
2024-08-27  9:30 ` Bough Chen
2024-08-27 11:57 ` Michael Walle [this message]
2024-08-31 12:21   ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D3QOCGDROG5A.361R73U5376FE@kernel.org \
    --to=mwalle@kernel.org \
    --cc=broonie@kernel.org \
    --cc=haibo.chen@nxp.com \
    --cc=han.xu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=yanzhen@vivo.com \
    --cc=yogeshgaur.83@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox