From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ladislav Michl Date: Fri, 24 Mar 2006 01:43:38 +0100 Subject: [U-Boot-Users] IMPORTANT NOTE to all maintainers with NAND flash In-Reply-To: <20060317211412.A6C00352B33@atlas.denx.de> References: <20060317185016.GA10588@orphique> <20060317211412.A6C00352B33@atlas.denx.de> Message-ID: <20060324004338.GA14228@orphique> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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