lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] selftests: watchdog: Add optional file argument
From
Date
On 8/30/19 6:53 AM, George G. Davis wrote:
> Some systems have multiple watchdog devices where the first device
> registered is assigned to the /dev/watchdog device file. In order
> to test other watchdog devices, add an optional file argument for
> selecting non-default watchdog devices for testing.
>
> Tested-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> Signed-off-by: George G. Davis <george_davis@mentor.com>
> ---
> v1:
> - https://lkml.org/lkml/2019/8/29/16
> v2:
> - Update printf for ENOENT case based on report from Eugeniu Rosca
> ---
> tools/testing/selftests/watchdog/watchdog-test.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
> index c2333c78cf04..9f17cae61007 100644
> --- a/tools/testing/selftests/watchdog/watchdog-test.c
> +++ b/tools/testing/selftests/watchdog/watchdog-test.c
> @@ -19,7 +19,7 @@
>
> int fd;
> const char v = 'V';
> -static const char sopts[] = "bdehp:t:Tn:NL";
> +static const char sopts[] = "bdehp:t:Tn:NLf:";
> static const struct option lopts[] = {
> {"bootstatus", no_argument, NULL, 'b'},
> {"disable", no_argument, NULL, 'd'},
> @@ -31,6 +31,7 @@ static const struct option lopts[] = {
> {"pretimeout", required_argument, NULL, 'n'},
> {"getpretimeout", no_argument, NULL, 'N'},
> {"gettimeleft", no_argument, NULL, 'L'},
> + {"file", required_argument, NULL, 'f'},
> {NULL, no_argument, NULL, 0x0}
> };
>
> @@ -69,6 +70,7 @@ static void term(int sig)
> static void usage(char *progname)
> {
> printf("Usage: %s [options]\n", progname);
> + printf(" -f, --file Open watchdog device file (default is /dev/watchdog)\n");

Can you split this line into two printf's. Checkpatch doesn't like
it.

printf(" -f, --file Open watchdog device file\n");
A second one below for default.

On a separate note, I wish this usage block uses \t instead of spacing
things out.

thanks,
-- Shuah


\
 
 \ /
  Last update: 2019-08-30 17:12    [W:0.071 / U:6.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site