[PATCH 3/3] selftests/timens: timerfd: Use correct clockid type in tclock_gettime()

Thomas Weißschuh posted 3 patches 9 months, 1 week ago
[PATCH 3/3] selftests/timens: timerfd: Use correct clockid type in tclock_gettime()
Posted by Thomas Weißschuh 9 months, 1 week ago
tclock_gettime() is a wrapper around clock_gettime().
The first parameter of clock_gettime() is of type "clockid_t",
not "clock_t".

Use the correct type instead.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/testing/selftests/timens/timerfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timens/timerfd.c b/tools/testing/selftests/timens/timerfd.c
index d6adf66bd8df064f5b76ccc265c13217d7a53f5b..402e2e4155450d946796b8297a8be85f93cea16f 100644
--- a/tools/testing/selftests/timens/timerfd.c
+++ b/tools/testing/selftests/timens/timerfd.c
@@ -15,7 +15,7 @@
 #include "log.h"
 #include "timens.h"
 
-static int tclock_gettime(clock_t clockid, struct timespec *now)
+static int tclock_gettime(clockid_t clockid, struct timespec *now)
 {
 	if (clockid == CLOCK_BOOTTIME_ALARM)
 		clockid = CLOCK_BOOTTIME;

-- 
2.49.0

Re: [PATCH 3/3] selftests/timens: timerfd: Use correct clockid type in tclock_gettime()
Posted by Muhammad Usama Anjum 9 months, 1 week ago
On 5/2/25 5:03 PM, Thomas Weißschuh wrote:
> tclock_gettime() is a wrapper around clock_gettime().
> The first parameter of clock_gettime() is of type "clockid_t",
> not "clock_t".
> 
> Use the correct type instead.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  tools/testing/selftests/timens/timerfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/timens/timerfd.c b/tools/testing/selftests/timens/timerfd.c
> index d6adf66bd8df064f5b76ccc265c13217d7a53f5b..402e2e4155450d946796b8297a8be85f93cea16f 100644
> --- a/tools/testing/selftests/timens/timerfd.c
> +++ b/tools/testing/selftests/timens/timerfd.c
> @@ -15,7 +15,7 @@
>  #include "log.h"
>  #include "timens.h"
>  
> -static int tclock_gettime(clock_t clockid, struct timespec *now)
> +static int tclock_gettime(clockid_t clockid, struct timespec *now)
>  {
>  	if (clockid == CLOCK_BOOTTIME_ALARM)
>  		clockid = CLOCK_BOOTTIME;
> 


-- 
Regards,
Usama