diff mbox series

[v2,5/8] lib: vdso: Remove checks on return value for 32 bit vDSO

Message ID 20190830135902.20861-6-vincenzo.frascino@arm.com (mailing list archive)
State Not Applicable
Headers show
Series vdso: Complete the conversion to 32bit syscalls | expand

Commit Message

Vincenzo Frascino Aug. 30, 2019, 1:58 p.m. UTC
Since all the architectures that support the generic vDSO library have
been converted to support the 32 bit fallbacks it is not required
anymore to check the return value of __cvdso_clock_get*time32_common()
before updating the old_timespec fields.

Remove the related checks from the generic vdso library.

Cc: Thomas Gleixner <tglx@linutronix.de>
CC: Andy Lutomirski <luto@kernel.org>
References: c60a32ea4f45 ("lib/vdso/32: Provide legacy syscall fallbacks")
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 lib/vdso/gettimeofday.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Vincenzo Frascino Aug. 30, 2019, 2:16 p.m. UTC | #1
On 30/08/2019 14:58, Vincenzo Frascino wrote:
> Since all the architectures that support the generic vDSO library have
> been converted to support the 32 bit fallbacks it is not required
> anymore to check the return value of __cvdso_clock_get*time32_common()
> before updating the old_timespec fields.
> 
> Remove the related checks from the generic vdso library.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> CC: Andy Lutomirski <luto@kernel.org>

Forgot to add to this patch:

Suggested-by: Andy Lutomirski <luto@kernel.org>

> References: c60a32ea4f45 ("lib/vdso/32: Provide legacy syscall fallbacks")
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
>  lib/vdso/gettimeofday.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 2c4b311c226d..d5bc16748f81 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -129,10 +129,10 @@ __cvdso_clock_gettime32(clockid_t clock, struct old_timespec32 *res)
>  	if (unlikely(ret))
>  		return clock_gettime32_fallback(clock, res);
>  
> -	if (likely(!ret)) {
> -		res->tv_sec = ts.tv_sec;
> -		res->tv_nsec = ts.tv_nsec;
> -	}
> +	/* For ret == 0 */
> +	res->tv_sec = ts.tv_sec;
> +	res->tv_nsec = ts.tv_nsec;
> +
>  	return ret;
>  }
>  #endif /* BUILD_VDSO32 */
> @@ -238,10 +238,10 @@ __cvdso_clock_getres_time32(clockid_t clock, struct old_timespec32 *res)
>  	if (unlikely(ret))
>  		return clock_getres32_fallback(clock, res);
>  
> -	if (likely(!ret)) {
> -		res->tv_sec = ts.tv_sec;
> -		res->tv_nsec = ts.tv_nsec;
> -	}
> +	/* For ret == 0 */
> +	res->tv_sec = ts.tv_sec;
> +	res->tv_nsec = ts.tv_nsec;
> +
>  	return ret;
>  }
>  #endif /* BUILD_VDSO32 */
>
diff mbox series

Patch

diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 2c4b311c226d..d5bc16748f81 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -129,10 +129,10 @@  __cvdso_clock_gettime32(clockid_t clock, struct old_timespec32 *res)
 	if (unlikely(ret))
 		return clock_gettime32_fallback(clock, res);
 
-	if (likely(!ret)) {
-		res->tv_sec = ts.tv_sec;
-		res->tv_nsec = ts.tv_nsec;
-	}
+	/* For ret == 0 */
+	res->tv_sec = ts.tv_sec;
+	res->tv_nsec = ts.tv_nsec;
+
 	return ret;
 }
 #endif /* BUILD_VDSO32 */
@@ -238,10 +238,10 @@  __cvdso_clock_getres_time32(clockid_t clock, struct old_timespec32 *res)
 	if (unlikely(ret))
 		return clock_getres32_fallback(clock, res);
 
-	if (likely(!ret)) {
-		res->tv_sec = ts.tv_sec;
-		res->tv_nsec = ts.tv_nsec;
-	}
+	/* For ret == 0 */
+	res->tv_sec = ts.tv_sec;
+	res->tv_nsec = ts.tv_nsec;
+
 	return ret;
 }
 #endif /* BUILD_VDSO32 */