2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 03:33:59 +08:00

selftests: watchdog: prefer strtoul() over atoi()

commit f15d7114bb ("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>
This commit is contained in:
Eugeniu Rosca 2017-07-01 14:57:27 +02:00 committed by Shuah Khan
parent 749fb263b3
commit 7a5e10d439

View File

@ -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);