* [PATCH] nandtest: fix --reads argument
@ 2014-08-14 16:29 Guido Martínez
2014-08-21 19:14 ` Ezequiel García
2014-09-08 10:30 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Guido Martínez @ 2014-08-14 16:29 UTC (permalink / raw)
To: linux-mtd, Artem Bityutskiy, Brian Norris
Cc: Ezequiel García, Guido Martínez
The --reads option specifies the argument as optional, but doesn't check
for a null optarg, which means that nandtest segfaults when run as
"nandtest --reads".
Fix this by making the argument required, and changing the help text to
not specify it as optional. Argument -r already specifies the argument
as required, so we fix this inconsistency too.
Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
---
nandtest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nandtest.c b/nandtest.c
index 8ea39d3..0805387 100644
--- a/nandtest.c
+++ b/nandtest.c
@@ -24,7 +24,7 @@ void usage(int status)
" -m, --markbad Mark blocks bad if they appear so\n"
" -s, --seed Supply random seed\n"
" -p, --passes Number of passes\n"
- " -r, --reads Read & check iterations per pass (default=4)\n"
+ " -r <n>, --reads=<n> Read & check <n> times per pass\n"
" -o, --offset Start offset on flash\n"
" -l, --length Length of flash to test\n"
" -k, --keep Restore existing contents after test\n",
@@ -166,7 +166,7 @@ int main(int argc, char **argv)
{ "passes", required_argument, 0, 'p' },
{ "offset", required_argument, 0, 'o' },
{ "length", required_argument, 0, 'l' },
- { "reads", optional_argument, 0, 'r' },
+ { "reads", required_argument, 0, 'r' },
{ "keep", no_argument, 0, 'k' },
{0, 0, 0, 0},
};
--
2.0.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nandtest: fix --reads argument
2014-08-14 16:29 [PATCH] nandtest: fix --reads argument Guido Martínez
@ 2014-08-21 19:14 ` Ezequiel García
2014-09-08 10:30 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Ezequiel García @ 2014-08-21 19:14 UTC (permalink / raw)
To: Guido Martínez; +Cc: Brian Norris, linux-mtd, Artem Bityutskiy
On 14 Aug 01:29 PM, Guido Martínez wrote:
> The --reads option specifies the argument as optional, but doesn't check
> for a null optarg, which means that nandtest segfaults when run as
> "nandtest --reads".
>
> Fix this by making the argument required, and changing the help text to
> not specify it as optional. Argument -r already specifies the argument
> as required, so we fix this inconsistency too.
>
> Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Nice catch!
Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
--
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nandtest: fix --reads argument
2014-08-14 16:29 [PATCH] nandtest: fix --reads argument Guido Martínez
2014-08-21 19:14 ` Ezequiel García
@ 2014-09-08 10:30 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2014-09-08 10:30 UTC (permalink / raw)
To: Guido Martínez; +Cc: Brian Norris, linux-mtd, Ezequiel García
On Thu, 2014-08-14 at 13:29 -0300, Guido Martínez wrote:
> The --reads option specifies the argument as optional, but doesn't check
> for a null optarg, which means that nandtest segfaults when run as
> "nandtest --reads".
>
> Fix this by making the argument required, and changing the help text to
> not specify it as optional. Argument -r already specifies the argument
> as required, so we fix this inconsistency too.
>
> Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Pushed, thanks!
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-08 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 16:29 [PATCH] nandtest: fix --reads argument Guido Martínez
2014-08-21 19:14 ` Ezequiel García
2014-09-08 10:30 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox