Re: [PATCH v2] selftests: watchdog: Add optional file argument

From: shuah
Date: Fri Aug 30 2019 - 12:20:28 EST


On 8/30/19 10:13 AM, George G. Davis wrote:
On Fri, Aug 30, 2019 at 09:12:10AM -0600, shuah wrote:
On 8/30/19 6:53 AM, George G. Davis wrote:
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -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.

Sure, I'll add the following interdiff in v3:

diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index 9f17cae61007..6a68b486dd61 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -70,7 +70,8 @@ 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");
+ printf(" -f, --file Open watchdog device file\n");
+ printf(" Default is /dev/watchdog\n");

Thanks. This is what I am looking for. Please send v3 with thsi change.

printf(" -b, --bootstatus Get last boot status (Watchdog/POR)\n");
printf(" -d, --disable Turn off the watchdog timer\n");
printf(" -e, --enable Turn on the watchdog timer\n");

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

I noticed that most of those lines are hard spaced with only one using tabs.
To remain consistent with existing CodingStyle, I used hard spaces.


yes. My comment about using "\t" can be done later and if you would like
to send for that patch, I will be happy to take it.

thanks,
-- Shuah