linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Viresh Kumar <viresh.kumar@st.com>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Vipin Kumar <vipin.kumar@st.com>,
	linux-mtd@lists.infradead.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Florian Fainelli <ffainelli@freebox.fr>,
	Jamie Iles <jamie@jamieiles.com>,
	Mike Dunn <mikedunn@newsguy.com>,
	Bastian Hecht <hechtb@gmail.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Kevin Cernekee <cernekee@gmail.com>, Lei Wen <leiwen@marvell.com>,
	Axel Lin <axel.lin@gmail.com>, Li Yang <leoli@freescale.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Armando Visconti <armando.visconti@st.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Scott Branden <sbranden@broadcom.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Huang Shijie <b32955@freescale.com>,
	Jiandong Zheng <jdzheng@broadcom.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 2/2] mtd: nand: nand_do_{read,write}_ops - pass OOB buffer through
Date: Wed, 18 Apr 2012 22:43:56 +0300	[thread overview]
Message-ID: <20120418224356.0709fc40@halley> (raw)
In-Reply-To: <4F8EE832.3090002@gmail.com>

Hi Brian,

On Wed, 18 Apr 2012 09:13:38 -0700 Brian Norris <computersforpeace@gmail.com> wrote:
> > So the 'oob' parameter is more of a boolean than an actual buffer to be
> > used by the various ecc.{read,write}_page implementors.
> 
> Yes, I suppose so. I naturally used 'oob' as a buffer, since that's very 
> straightforward and logical from a 'layers' perspective and because my 
> driver doesn't need any buffer when oob is not required. But I see that 
> it essentially would become a boolean flag for many of the other 
> interfaces, and so a boolean can work just as well.
> 
> > Any reason not to pass a boolean instead?
> 
> Only reason I'm thinking of: a cleaner interface.
> 
> To me, the interface is rather non-obvious and ugly when data is 
> constantly shuttled back and forth behind the scenes (i.e., not via 
> function arguments or ret values) by using chip->oob_poi.
> 
> However, this sense of "ugliness" competes with the ugliness of needing 
> a buffer even when the interface might otherwise say "no OOB." Many 
> {read,write}_page functions would need something like:
> 
>      uint8_t *oobbuf = oob ? oob : chip->oob_poi;
> 
> which is not pretty.
> 
> I'm open to either way, I guess, but I'm now leaning a little toward 
> 'oob' as a boolean.

Yes, both approaches aren't perfect.

However a 'int has_user_oob' (or 'has_oob') has a precise, consistent
meaning: the mtd user explicitly provided an OOB buffer (or in the read
case, the mtd user expects the OOB to be returned).
(need help with the boolean's name, though)

Also, I think it will result in less changes (makes the whole
s/oob/oobbuf/ collateral damage of 1st patch irrelevant).

So IMO a boolean is better.

Regards,
Shmulik

  reply	other threads:[~2012-04-18 19:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 22:35 [PATCH 0/2] mtd: nand: rework nand_ecc_ctrl interface for OOB Brian Norris
2012-04-16 22:35 ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read, write}_page interfaces Brian Norris
2012-04-17  7:50   ` Matthieu CASTET
2012-04-18  3:44     ` Brian Norris
2012-04-19 16:50       ` Mike Dunn
2012-04-19 22:06         ` Brian Norris
2012-04-20  1:10           ` Jon Povey
2012-04-20 16:25             ` Mike Dunn
2012-04-20 19:19               ` Brian Norris
2012-04-20 16:17           ` Mike Dunn
2012-04-22  7:58           ` Shmulik Ladkani
2012-04-23  9:14             ` Bastian Hecht
2012-04-23 17:14               ` Mike Dunn
2012-04-24  6:02               ` Shmulik Ladkani
2012-04-25 13:17                 ` Bastian Hecht
2012-04-17 14:29   ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read,write}_page interfaces Shmulik Ladkani
2012-04-18  4:11     ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read, write}_page interfaces Brian Norris
2012-04-18  7:56   ` Bastian Hecht
2012-04-18  9:37     ` Bastian Hecht
2012-04-18 16:22       ` Brian Norris
2012-04-19  9:26         ` Bastian Hecht
2012-04-16 22:35 ` [PATCH 2/2] mtd: nand: nand_do_{read, write}_ops - pass OOB buffer through Brian Norris
2012-04-18 11:52   ` [PATCH 2/2] mtd: nand: nand_do_{read,write}_ops " Shmulik Ladkani
2012-04-18 16:13     ` [PATCH 2/2] mtd: nand: nand_do_{read, write}_ops " Brian Norris
2012-04-18 19:43       ` Shmulik Ladkani [this message]
2012-04-25 14:16 ` [PATCH 0/2] mtd: nand: rework nand_ecc_ctrl interface for OOB Artem Bityutskiy
2012-04-25 18:26   ` Brian Norris

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=20120418224356.0709fc40@halley \
    --to=shmulik.ladkani@gmail.com \
    --cc=armando.visconti@st.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=axel.lin@gmail.com \
    --cc=b32955@freescale.com \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ffainelli@freebox.fr \
    --cc=hechtb@gmail.com \
    --cc=jamie@jamieiles.com \
    --cc=jdzheng@broadcom.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=leiwen@marvell.com \
    --cc=leoli@freescale.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=sbranden@broadcom.com \
    --cc=tglx@linutronix.de \
    --cc=vipin.kumar@st.com \
    --cc=viresh.kumar@st.com \
    --cc=w.sang@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).