From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 11 Dec 2012 11:13:55 -0600 Subject: [U-Boot] [PATCH] [nand] Implement nand_extent_skip_bad In-Reply-To: (from panto@antoniou-consulting.com on Tue Dec 11 03:40:53 2012) References: <1355153064-6008-1-git-send-email-panto@antoniou-consulting.com> <1355180015.5334.15@snotra> Message-ID: <1355246035.13481.2@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/11/2012 03:40:53 AM, Pantelis Antoniou wrote: > Hi Scott, > > On Dec 11, 2012, at 12:53 AM, Scott Wood wrote: > > >> +/** > >> + * nand_extent_skip_bad: > >> + * > >> + * Find the extent of a chunk, return the offset where it ends > >> + * Blocks that are marked bad are skipped and the next block is > examined > >> + * instead as long as the extend is short enough to fit even > after skipping the > >> + * bad blocks. > >> + * > >> + * @param nand NAND device > >> + * @param offset offset in flash > >> + * @param length extend length > >> + * @return next offset in case of success (loff_t)-1 on error > >> + */ > > > > Would it be better to return this information from existing > read/write functions -- either instead of or in addition to exporting > this functionality? > > > > Yes it would. However that would require modifying all callers, which > would be a hard sell when there's only one user of it. There aren't that many callers, and it's all common code (so no issue with testing on obscure hardware). > > This seems duplicative of check_skip_len(). > > > > It is. check_skip_len doesn't return the information I need. I could > modify check_skip_len with > an extra parameter if that's going to be OK with you. Yes, please modify check_skip_len() instead. -Scott