All of lore.kernel.org
 help / color / mirror / Atom feed
* mtd: test: Fix check on ebcnt in nandpagetest
@ 2017-11-22  9:50 Paul HENRYS d'AUBIGNY
  2017-11-22 11:53 ` David Oberhollenzer
  0 siblings, 1 reply; 2+ messages in thread
From: Paul HENRYS d'AUBIGNY @ 2017-11-22  9:50 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Dear all,

Commit 4458ad6481f60d9884925d5bc62a7954880d181b introduced a check on
ebcnt to make sure nandpagetest is run on more than 2 erase blocks
(EB). This commit omits that by default, when the number of EB to use
is not specified, the full mtd partition should be used leading
nandpagetest to exit with failure in that case.
The attached patch intends to fix this.

Best regards,

Paul HENRYS

Software Engineer - Freelance
http://be.linkedin.com/in/phenrysd
PGP fingerprint: 1C45 321A 7830 4DCD 8453 2CE4 DF32 6222 6747 82F7
PGP key: https://pgp.mit.edu/pks/lookup?op=get&search=0xDF326222674782F7

[-- Attachment #2: nandpagetest.patch --]
[-- Type: text/x-patch, Size: 1168 bytes --]

From f49edcf3a1ec60eccfdf8062154dea4968f65fe3 Mon Sep 17 00:00:00 2001
From: Paul HENRYS <paul.henrys@embconsulting.eu>
Date: Wed, 22 Nov 2017 09:11:43 +0100
Subject: [PATCH] mtd: tests: Fix check on ebcnt in nandpagetest

If the number of erase blocks to use is not specified, ebcnt originally
set to -1 leads the program to exit with:
  "Cannot run with less than two blocks."

If the number of erase blocks to use is not specified and thus ebcnt is
equal to -1, the expected behaviour is to perform the test on all the
erase blocks of the mtd partition.

This fixes the change introduced in
4458ad6481f60d9884925d5bc62a7954880d181b.
---
 tests/mtd-tests/nandpagetest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/mtd-tests/nandpagetest.c b/tests/mtd-tests/nandpagetest.c
index 2b16cc9..c6812df 100644
--- a/tests/mtd-tests/nandpagetest.c
+++ b/tests/mtd-tests/nandpagetest.c
@@ -143,7 +143,7 @@ static void process_options(int argc, char **argv)
 
 	if (optind < argc)
 		usage(EXIT_FAILURE);
-	if (ebcnt < 2)
+	if (ebcnt >= 0 && ebcnt < 2)
 		errmsg_die("Cannot run with less than two blocks.");
 	if (peb < 0)
 		peb = 0;
-- 
2.7.4


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

* Re: mtd: test: Fix check on ebcnt in nandpagetest
  2017-11-22  9:50 mtd: test: Fix check on ebcnt in nandpagetest Paul HENRYS d'AUBIGNY
@ 2017-11-22 11:53 ` David Oberhollenzer
  0 siblings, 0 replies; 2+ messages in thread
From: David Oberhollenzer @ 2017-11-22 11:53 UTC (permalink / raw)
  To: linux-mtd; +Cc: Paul HENRYS d'AUBIGNY

Applied to mtd-utils.git

Thanks,

David

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

end of thread, other threads:[~2017-11-22 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22  9:50 mtd: test: Fix check on ebcnt in nandpagetest Paul HENRYS d'AUBIGNY
2017-11-22 11:53 ` David Oberhollenzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.