[U-Boot] [PATCH v3 1/4] nand: Extend nand_(read|write)_skip_bad with *actual and limit parameters

Scott Wood scottwood at freescale.com
Mon Mar 4 20:15:58 CET 2013


On 03/03/2013 08:04:01 AM, Tom Rini wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 03/01/2013 09:59 PM, Scott Wood wrote:
> > On 03/01/2013 09:57:40 AM, Tom Rini wrote:
> >> On Thu, Feb 28, 2013 at 07:37:51PM -0600, Scott Wood wrote:
> >>>> + * @param lim        maximum size that length may be in
> >>>> order to not + *            exceed the buffer
> >>>
> >>> s/that length may be/that actual may be/
> >>
> >> No?  We check that the requested length to something will fit
> >> even if the caller doesn't care to know what actual is.
> >
> > What I mean is that we're not saying "if (length > lim) error".
> > We compute the actual, and if the actual exceeds "lim", then
> > there's an error.
> 
> OK, I see your point.  My hang-up is that actual may be NULL.

That's just the pointer to store the actual length in, which is just an  
implementation detail of how we return additional values.  We still  
compute the actual length.  I'd hope it would be obvious that we're not  
talking about the pointer here.

>  So, "maximum size that length may be once bad blocks are accounted  
> for in
> order to not exceed the buffer" ?

I think it would be better to not have to describe the concept twice.

-Scott


More information about the U-Boot mailing list