[PATCH] time: drop cast from NOW()

Jan Beulich posted 1 patch 8 months, 2 weeks ago
Failed in applying to current master (apply log)
[PATCH] time: drop cast from NOW()
Posted by Jan Beulich 8 months, 2 weeks ago
It gives the wrong impression of there being a type change, when
get_s_time() really returns s_time_t itself (kind of naturally given its
name).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- unstable.orig/xen/include/xen/time.h	2024-11-21 21:12:47.000000000 +0100
+++ unstable/xen/include/xen/time.h	2025-04-03 13:17:59.784804154 +0200
@@ -53,7 +53,7 @@ struct tm gmtime(unsigned long t);
 struct tm wallclock_time(uint64_t *ns);
 
 #define SYSTEM_TIME_HZ  1000000000ULL
-#define NOW()           ((s_time_t)get_s_time())
+#define NOW()           get_s_time()
 #define DAYS(_d)        SECONDS((_d) * 86400ULL)
 #define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
Re: [PATCH] time: drop cast from NOW()
Posted by Andrew Cooper 8 months, 2 weeks ago
On 03/04/2025 12:25 pm, Jan Beulich wrote:
> It gives the wrong impression of there being a type change, when
> get_s_time() really returns s_time_t itself (kind of naturally given its
> name).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>