summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEugeniu Rosca <erosca@de.adit-jv.com>2017-07-01 14:57:27 +0200
committerShuah Khan <shuahkh@osg.samsung.com>2017-07-24 12:36:47 -0600
commit7a5e10d439b162ae76e7d7a1bbd5653e62abb5bf (patch)
tree2397798eb051d1d644028616072bd60b8006c5af /tools
parent749fb263b304faf60adbbf34988624fa7f33db1b (diff)
downloadlinux-7a5e10d439b162ae76e7d7a1bbd5653e62abb5bf.tar.gz
linux-7a5e10d439b162ae76e7d7a1bbd5653e62abb5bf.tar.bz2
linux-7a5e10d439b162ae76e7d7a1bbd5653e62abb5bf.zip
selftests: watchdog: prefer strtoul() over atoi()
commit f15d7114bbdd ("Documentation/watchdog: add timeout and ping rate control to watchdog-test.c") used both atoi() and strtoul() for string to integer conversion. As usage of atoi() is discouraged in newer code, replace it with strtoul() for consistency. Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/watchdog/watchdog-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index e7c9d3bdae56..5cfa88c73095 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
printf("Watchdog ping rate set to %u seconds.\n", ping_rate);
break;
case 't':
- flags = atoi(optarg);
+ flags = strtoul(optarg, NULL, 0);
ret = ioctl(fd, WDIOC_SETTIMEOUT, &flags);
if (!ret)
printf("Watchdog timeout set to %u seconds.\n", flags);