[U-Boot-Users] Re: Your patch NAND READ.JFFS2S
Joachim Jaeger
jjaeger at fsforth.de
Wed Mar 16 17:08:42 CET 2005
Hi Wolfgang,
Wolfgang Denk wrote:
> [I'm not sure which message this is a Re: to, as I haven't seen any
> message(s) with this subject (yet?)]
my first message was sent at 10.03.05 11:00 o'clock to this list, where
I reported the problem with the nand read.jffs2s command
Today I received a Re to this mail from Frieder, but the list not included.
Because I wanted the list to know about the patch, I CCed the list
within this mail.
>
>
> In message <42384865.5080100 at fsforth.de> you wrote:
>
>>you are right, the } has to be moved also.
>>So the correct patch is:
>>
>> else if (cmdtail && !strncmp(cmdtail, ".jffs2s", 2)) {
>> cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */
>> if (cmd & NANDRW_READ)
>> cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on
>> read too) */
>> + }
>> + else if (cmdtail && !strncmp(cmdtail, ".jffs2", 2))
>> + cmd |= NANDRW_JFFS2; /* skip bad blocks */
>
>
> I woould reject this because it is violating the coding style.
> ['}' and 'else' on the same line; indentation by TAB].
Sorry for this violation, but I copied the parts from u-boot version
1.1.2 (cmd_nand.c):
if (cmdtail && !strncmp(cmdtail, ".oob", 2)) {
/* read out-of-band data */
if (cmd & NANDRW_READ) {
ret = nand_read_oob(nand_dev_desc + curr_device,
off, size, &total,
(u_char*)addr);
}
else {
ret = nand_write_oob(nand_dev_desc + curr_device,
off, size, &total,
(u_char*)addr);
}
return ret;
}
else if (cmdtail && !strncmp(cmdtail, ".jffs2", 2))
cmd |= NANDRW_JFFS2; /* skip bad blocks */
else if (cmdtail && !strncmp(cmdtail, ".jffs2s", 2)) {
cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */
if (cmd & NANDRW_READ)
cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on read too) */
}
So the patch should be:
else if (cmdtail && !strncmp(cmdtail, ".jffs2s", 2)) {
cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */
if (cmd & NANDRW_READ)
cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on
read too) */
+ } else if (cmdtail && !strncmp(cmdtail, ".jffs2", 2))
+ cmd |= NANDRW_JFFS2; /* skip bad blocks */
>
Regards
Joachim
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>
--
*********************************************************
For more information: http://www.fsforth.de
*********************************************************
Joachim Jaeger
FS FORTH-SYSTEME GmbH
Kueferstr. 8, D-79206 Breisach
Phone: +49 (7667) 908-146, FAX +49 (7667) 908-246
More information about the U-Boot
mailing list