diff mbox series

[mtd-utils,02/10] nand-utils: nanddump: Explicitely use the page size when relevant

Message ID 20240826094629.19065-3-miquel.raynal@bootlin.com
State New
Headers show
Series New options for hardening continuous read support | expand

Commit Message

Miquel Raynal Aug. 26, 2024, 9:46 a.m. UTC
Using bs when skipping the bad sector is abusive as what we want is
using the size of a block and the size of a page. The fact that bs
currently is the size of a page is misleading here, has I intend to make
this amount grow.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 nand-utils/nanddump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/nand-utils/nanddump.c b/nand-utils/nanddump.c
index 346af1e..a3e6e92 100644
--- a/nand-utils/nanddump.c
+++ b/nand-utils/nanddump.c
@@ -458,7 +458,7 @@  int main(int argc, char * const argv[])
 			/* skip bad block, increase end_addr */
 			if (bb_method == skipbad) {
 				end_addr += mtd.eb_size;
-				ofs += mtd.eb_size - bs;
+				ofs += mtd.eb_size - mtd.min_io_size;
 				if (end_addr > mtd.size)
 					end_addr = mtd.size;
 				continue;