Thread (39 messages) 39 messages, 7 authors, 2025-08-20

Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

From: David Laight <hidden>
Date: 2025-07-19 11:17:02
Also in: linux-arch, linux-kselftest, lkml

On Wed, 16 Jul 2025 15:35:09 +0100
Mark Brown [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Wed, Jul 16, 2025 at 03:23:24PM +0200, Thomas Weißschuh wrote:
quoted
Can you try the following?
I missed this despite the double-checking after the last reported issue.  
I needed to fix that up a bit, it was missing an update of the final ret
in the function and didn't apply directly to -next for some reason so I
had to manually apply but it seems to do the trick, thanks!

Tested-by: Mark Brown <broonie@kernel.org>

with this against -next:
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 97aa9059a5c97..487e3458e536e 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -365,18 +365,18 @@ __cvdso_clock_gettime32_data(const struct vdso_time_data *vd, clockid_t clock,
 			     struct old_timespec32 *res)
 {
 	struct __kernel_timespec ts;
-	int ret;
+	bool ok;
 
-	ret = __cvdso_clock_gettime_common(vd, clock, &ts);
+	ok = __cvdso_clock_gettime_common(vd, clock, &ts);
 
-	if (unlikely(ret))
+	if (unlikely(!ok))
Do you even need 'ok' at all, just:
	if (unlikely(!__cvdso_clock_gettime_common(vd, clock, &ts)))
 		return clock_gettime32_fallback(clock, res);
 
-	/* For ret == 0 */
+	/* For ok == true */
 	res->tv_sec = ts.tv_sec;
 	res->tv_nsec = ts.tv_nsec;
 
-	return ret;
+	return 0;
 }
 
 static __maybe_unused int
	David


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help