linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nanddump: verify that start address is page aligned
@ 2010-10-12  8:23 Baruch Siach
  2010-10-12  8:23 ` [PATCH 2/2] nanddump: always check the first erase block Baruch Siach
  2010-10-16 19:08 ` [PATCH 1/2] nanddump: verify that start address is page aligned Artem Bityutskiy
  0 siblings, 2 replies; 6+ messages in thread
From: Baruch Siach @ 2010-10-12  8:23 UTC (permalink / raw)
  To: linux-mtd; +Cc: Baruch Siach

Make nanddump consistent with nandwrite, which does not accept non page aligned
start addresses. Thus, non page aligned dumps are useless.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 nanddump.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/nanddump.c b/nanddump.c
index 0fdf736..d6d1352 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -377,6 +377,12 @@ int main(int argc, char * const argv[])
 	}
 
 	/* Initialize start/end addresses and block size */
+	if (start_addr & (meminfo.writesize - 1)) {
+		fprintf(stderr, "The start address is not page-aligned !\n"
+				"The pagesize of this NAND Flash is 0x%x.\n",
+				meminfo.writesize);
+		goto closeall;
+	}
 	if (length)
 		end_addr = start_addr + length;
 	if (!length || end_addr > meminfo.size)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-18 10:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-12  8:23 [PATCH 1/2] nanddump: verify that start address is page aligned Baruch Siach
2010-10-12  8:23 ` [PATCH 2/2] nanddump: always check the first erase block Baruch Siach
2010-10-16 19:11   ` Artem Bityutskiy
2010-10-16 19:08 ` [PATCH 1/2] nanddump: verify that start address is page aligned Artem Bityutskiy
2010-10-18  7:23   ` [PATCH] nanddump: warn when the start address is not " Baruch Siach
2010-10-18 10:31     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).