[U-Boot] [PATCH] fw_env: add NAND support
Wolfgang Denk
wd at denx.de
Wed Sep 3 15:23:31 CEST 2008
Dear Guennadi,
In message <alpine.DEB.1.00.0809031108220.6727 at axis700.grange> you wrote:
>
> > would become:
> >
> > if (crc0_ok && !crc1_ok) {
> > dev_current = 0;
> > } else if (!crc0_ok && crc1_ok) {
> > dev_current = 1;
> >
> > If "0" is OK, then use "0"; if "1" is ok then use "1".
> >
> > Your version: if "1" is OK then use "0", if "2" is OK then use "1"
> > is more difficult to read.
> >
> > [Or stick with the old identifiers, i. e. use 1 and 2 consistently,
> > but don't mix 0/1 here and 1/2 there.]
>
> Sorry, don't understand. This is the original code:
>
> if (crc1_ok && !crc2_ok) {
> environment.data = addr1;
> environment.flags = flag1;
> environment.crc = crc1;
> curdev = 0;
> free (addr2);
>
> Which looks to me like "if (crc1_ok...) {... curdev = 0;...}", which I
> tried to preserve. So, you would prefer me to _change_ it?
...except that that nor "curdev =0" is present anywhere, but instead
the index "1" is used consistently: crc1_ok, addr1, flag1, crc1.
> As far as I understand, with rc == 3 there is no DEVESIZE in the line,
> which doesn't look like a valid configuration line to me. The orginal code
> however accepted such lines and only dropped lines with rc < 3. I do not
> understand how the original code managed to work with rc == 3. As I
> thought this was a bug, I changed the test to "rc < 4", i.e., now I
Did you verify that is was a bug?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Ever try. Ever fail. No matter. Try again. Fail again. Fail better.
-- S. Beckett
More information about the U-Boot
mailing list