Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel RAYNAL <miquel.raynal@free-electrons.com>
To: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	linux-mtd@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Nadav Haklai <nadavh@marvell.com>,
	Ofer Heifetz <oferh@marvell.com>, Hanna Hawa <hannah@marvell.com>
Subject: Re: [PATCH v2] mtd: nand: add ->exec_op() implementation
Date: Mon, 11 Dec 2017 21:17:50 +0100	[thread overview]
Message-ID: <20171211211750.0e74d951@xps13> (raw)
In-Reply-To: <20171208075450.GA4359@kwain>

Hello Antoine,

On Fri, 8 Dec 2017 08:54:50 +0100
Antoine Tenart <antoine.tenart@free-electrons.com> wrote:

> Hi Miquel,
> 
> Be careful when defining macros: avoid to name your arguments with a
> value used in the macro that is not meant to be replaced.

That is right, it could have failed the macro.

Thank you for the tip,
Miquèl

> 
> On Thu, Dec 07, 2017 at 03:54:34PM +0100, Miquel Raynal wrote:
> > +
> > +#define NAND_OP_DATA_IN(l, buf,
> > ns)					\
> > +
> > {								\
> > +		.type =
> > NAND_OP_DATA_IN_INSTR,				\
> > +		.ctx.data =
> > {						\
> > +			.len =
> > l,					\
> > +			.buf.in =
> > buf,					\  
> 
> Here.
> 
> > +			.force_8bit =
> > false,				\
> > +		},
> > \
> > +		.delay_ns =
> > ns,						\
> > +	}
> > +
> > +#define NAND_OP_DATA_OUT(l, buf,
> > ns)					\
> > +
> > {								\
> > +		.type =
> > NAND_OP_DATA_OUT_INSTR,				\
> > +		.ctx.data =
> > {						\
> > +			.len =
> > l,					\
> > +			.buf.out =
> > buf,					\  
> 
> And here.
> 
> > +			.force_8bit =
> > false,				\
> > +		},
> > \
> > +		.delay_ns =
> > ns,						\
> > +	}  
> 
> It works in your series because these macros are always called with
> the second argument being a variable named 'buf', but that's not safe.
> 
> Thanks!
> Antoine
> 



-- 
Miquel Raynal, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-12-11 20:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 14:54 [PATCH v2] mtd: nand: add ->exec_op() implementation Miquel Raynal
2017-12-08  7:54 ` Antoine Tenart
2017-12-11 20:17   ` Miquel RAYNAL [this message]
2017-12-11 20:52     ` Boris Brezillon

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=20171211211750.0e74d951@xps13 \
    --to=miquel.raynal@free-electrons.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=nadavh@marvell.com \
    --cc=oferh@marvell.com \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@free-electrons.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