diff options
author | Eugeniu Rosca <erosca@de.adit-jv.com> | 2017-07-01 14:57:26 +0200 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-07-24 12:36:29 -0600 |
commit | 749fb263b304faf60adbbf34988624fa7f33db1b (patch) | |
tree | 3a78030d4d2f84776fc5793b48affd082189db28 /tools/leds | |
parent | selftests: watchdog: fix mixed whitespace (diff) | |
download | linux-dev-749fb263b304faf60adbbf34988624fa7f33db1b.tar.xz linux-dev-749fb263b304faf60adbbf34988624fa7f33db1b.zip |
selftests: watchdog: use getopt_long()
Switch from manual argv[] parsing to getopt_long() argument processing.
This creates more readable code and allows easier feature addition.
This also fixes some segmentation faults introduced by
commit 1dbdcc810928 ("selftests: watchdog: accept multiple params on
command line"), when options -t or -p are not given the required value:
./watchdog-test -p 1 -t
./watchdog-test -t 1 -p
No changes are intended in the way watchdog-test interacts with the
kernel. The only noticible changes, tightly related to the addition
of getopt (and done for easier maintenance), are:
- help message has been reworked and migrated to a dedicated function.
- all short/long options and the help message are sorted alphabetically.
- all case statements inside the getopt loop are sorted alphabetically.
Fixes: 1dbdcc810928 ("selftests: watchdog: accept multiple params on command line")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/leds')
0 files changed, 0 insertions, 0 deletions