[U-Boot] [PATCH 4/5 V2] NAND: Make page, erase, oob size available via cmd_nand
Marek Vasut
marek.vasut at gmail.com
Tue Sep 27 22:07:05 CEST 2011
On Tuesday, September 27, 2011 09:51:09 PM Scott Wood wrote:
> On 09/27/2011 02:38 PM, Marek Vasut wrote:
> > On Tuesday, September 27, 2011 09:01:53 PM Scott Wood wrote:
> >> On Thu, Sep 22, 2011 at 03:57:26AM +0200, Marek Vasut wrote:
> >>> + /* Set geometry info */
> >>> + memset(buf, 0, bufsz);
> >>> + sprintf(buf, "%x", nand->writesize);
> >>> + setenv("nand_writesize", buf);
> >>> +
> >>> + memset(buf, 0, bufsz);
> >>> + sprintf(buf, "%x", nand->oobsize);
> >>> + setenv("nand_oobsize", buf);
> >>> +
> >>> + memset(buf, 0, bufsz);
> >>> + sprintf(buf, "%x", nand->erasesize);
> >>> + setenv("nand_erasesize", buf);
> >>
> >> Why the memsets?
> >
> > To clear the memory from previous usage ?
>
> What part of the previous usage will both survive the sprintf() and be
> looked at by setenv()?
The part of data that are copied in _do_set_env() ?
>
> -Scott
More information about the U-Boot
mailing list