diff mbox series

[10/18] linux: timerfd_gettime minor cleanup

Message ID 20210617115104.1359598-11-adhemerval.zanella@linaro.org
State Committed
Headers show
Series More y2038 fixes | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Adhemerval Zanella June 17, 2021, 11:50 a.m. UTC
The __NR_timerfd_gettime64 is always defined.
---
 sysdeps/unix/sysv/linux/timerfd_gettime.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Lukasz Majewski June 21, 2021, 7:43 a.m. UTC | #1
On Thu, 17 Jun 2021 08:50:56 -0300
Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:

> The __NR_timerfd_gettime64 is always defined.
> ---
>  sysdeps/unix/sysv/linux/timerfd_gettime.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/timerfd_gettime.c
> b/sysdeps/unix/sysv/linux/timerfd_gettime.c index
> 89f8066b91..5f668257c4 100644 ---
> a/sysdeps/unix/sysv/linux/timerfd_gettime.c +++
> b/sysdeps/unix/sysv/linux/timerfd_gettime.c @@ -25,17 +25,17 @@
>  int
>  __timerfd_gettime64 (int fd, struct __itimerspec64 *value)
>  {
> +#ifndef __NR_timerfd_gettime64
> +# define __NR_timerfd_gettime64 __NR_timerfd_gettime
> +#endif
> +
>  #ifdef __ASSUME_TIME64_SYSCALLS
> -# ifndef __NR_timerfd_gettime64
> -#  define __NR_timerfd_gettime64 __NR_timerfd_gettime
> -# endif
>    return INLINE_SYSCALL_CALL (timerfd_gettime64, fd, value);
>  #else
> -# ifdef __NR_timerfd_gettime64
>    int ret = INLINE_SYSCALL_CALL (timerfd_gettime64, fd, value);
>    if (ret == 0 || errno != ENOSYS)
>      return ret;
> -# endif
> +
>    struct itimerspec its32;
>    int retval = INLINE_SYSCALL_CALL (timerfd_gettime, fd, &its32);
>    if (retval == 0)

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/timerfd_gettime.c b/sysdeps/unix/sysv/linux/timerfd_gettime.c
index 89f8066b91..5f668257c4 100644
--- a/sysdeps/unix/sysv/linux/timerfd_gettime.c
+++ b/sysdeps/unix/sysv/linux/timerfd_gettime.c
@@ -25,17 +25,17 @@ 
 int
 __timerfd_gettime64 (int fd, struct __itimerspec64 *value)
 {
+#ifndef __NR_timerfd_gettime64
+# define __NR_timerfd_gettime64 __NR_timerfd_gettime
+#endif
+
 #ifdef __ASSUME_TIME64_SYSCALLS
-# ifndef __NR_timerfd_gettime64
-#  define __NR_timerfd_gettime64 __NR_timerfd_gettime
-# endif
   return INLINE_SYSCALL_CALL (timerfd_gettime64, fd, value);
 #else
-# ifdef __NR_timerfd_gettime64
   int ret = INLINE_SYSCALL_CALL (timerfd_gettime64, fd, value);
   if (ret == 0 || errno != ENOSYS)
     return ret;
-# endif
+
   struct itimerspec its32;
   int retval = INLINE_SYSCALL_CALL (timerfd_gettime, fd, &its32);
   if (retval == 0)