diff mbox series

[mtd-utils,06/10] mtd-tests: flash_speed: Drop an apparently useless block

Message ID 20240826094629.19065-7-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
I know no device without a multiple of 2 number of pages in each
block. Even though it might be the case, it is clearly not a big deal
and we don't really care about reading the last page, we are doing a
speed benchmark; so as long as the throughput calculation knows how much
data has been read it's fine. Eitherway, I don't think we ever have
fallen in this block because we would read the content of two pages (so
one past the block) and put it in a page-wide buffer, which would
probably lead to an out-of-bound abort.

Just drop the block.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 tests/mtd-tests/flash_speed.c | 7 -------
 1 file changed, 7 deletions(-)
diff mbox series

Patch

diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c
index 3489233..f542a8d 100644
--- a/tests/mtd-tests/flash_speed.c
+++ b/tests/mtd-tests/flash_speed.c
@@ -265,13 +265,6 @@  static int read_eraseblock_by_2pages(int ebnum)
 		}
 		buf += sz;
 	}
-	if (pgcnt % 2) {
-		err = mtd_read(&mtd, fd, ebnum, i * sz, iobuf, pgsize);
-		if (err) {
-			fprintf(stderr, "Error reading block %d, page %d!\n",
-					ebnum, i*2);
-		}
-	}
 
 	return err;
 }