mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Michael Walle' <mwalle@kernel.org>, Yan Zhen <yanzhen@vivo.com>,
	"han.xu@nxp.com" <han.xu@nxp.com>,
	"haibo.chen@nxp.com" <haibo.chen@nxp.com>,
	"broonie@kernel.org" <broonie@kernel.org>
Cc: "yogeshgaur.83@gmail.com" <yogeshgaur.83@gmail.com>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"opensource.kernel@vivo.com" <opensource.kernel@vivo.com>
Subject: RE: [PATCH v1] spi: nxp-fspi: Use min macro
Date: Sat, 31 Aug 2024 12:21:48 +0000	[thread overview]
Message-ID: <0cfbe737318f4c27b729c0d91d540abf@AcuMS.aculab.com> (raw)
In-Reply-To: <D3QOCGDROG5A.361R73U5376FE@kernel.org>

From: Michael Walle
> Sent: 27 August 2024 12:58
> 
> 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()?

You should pretty much never use max_t().
Using it is just an accident waiting to happen.

	David

> 
> -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);

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      reply	other threads:[~2024-08-31 12:22 UTC|newest]

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

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=0cfbe737318f4c27b729c0d91d540abf@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --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=mwalle@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

all inboxes | Powered by JetHome®