[U-Boot-Users] IMPORTANT NOTE to all maintainers with NAND flash

Ladislav Michl ladis at linux-mips.org
Fri Mar 24 01:43:38 CET 2006


On Fri, Mar 17, 2006 at 10:14:12PM +0100, Wolfgang Denk wrote:
> > +		int clean = (argc > 2 && strcmp(argv[2], "clean") == 0) ? 1 : 0;
> > +		int o = clean ? 3 : 2;
> > +		arg_off_size(argc - o, argv + o, &off, &size, nand->size);
> 
> Can you please re-implement this in a bit a less cryptic way? I  will
> not  complain  if  it takes 6 lines instead of 3. LoC are cheap these
> days ;-)

Syntax is:
	0	1	2	3	4
	nand	erase 	[clean] [off 	size]

So we just look if there are more that two arguments and argument at
index 2 is "clean". In that case we want also erase OOB. Then we just
skip first 2 or 3 argumets while looking for offset and size. Shall
I try harder to reimplement it or is additional comment okay? ;-)

Best regards,
	ladis




More information about the U-Boot mailing list