From c5a04a0150c9e92dc0b00da326aad77ac25fd485 Mon Sep 17 00:00:00 2001 From: sigsegv7 Date: Wed, 20 Sep 2023 02:28:53 -0400 Subject: kernel: dev: Use errno.h error codes This commit makes the hpet_sleep() function return either EXIT_SUCCESS or EXIT_FAILURE instead of hardcoded constants. Signed-off-by: sigsegv7 --- sys/dev/timer/hpet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/timer/hpet.c b/sys/dev/timer/hpet.c index f5b1621..08c4432 100644 --- a/sys/dev/timer/hpet.c +++ b/sys/dev/timer/hpet.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -107,7 +108,7 @@ hpet_sleep(uint64_t n, uint64_t units) /* Don't even try if faulty, would probably cause deadlock */ if (is_faulty) { - return 1; + return EXIT_FAILURE; } caps = hpet_read(HPET_REG_CAPS); @@ -120,7 +121,7 @@ hpet_sleep(uint64_t n, uint64_t units) spinwait_hint(); } - return 0; + return EXIT_SUCCESS; } int -- cgit v1.2.3