[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/time: address Misra C:2012 rule 8.3



commit 9c2e34b1a38dab43458804a2dcf859fd187d4671
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri May 22 12:17:24 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri May 22 12:17:24 2026 +0200

    x86/time: address Misra C:2012 rule 8.3
    
    Before we can enable scanning of time.c, it needs to be clean wrt blocking
    rules. Bring boot_tsc_stamp's definition in line with its declaration. For
    get_s_time_fixed() go a little farther and move it to the x86 header (the
    function only exists in x86) and do, along with correcting the parameter
    name, the u64 -> uint64_t a little more widely than strictly necessary.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 xen/arch/x86/include/asm/time.h | 2 ++
 xen/arch/x86/time.c             | 6 +++---
 xen/include/xen/time.h          | 1 -
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 44f995ff05..ed763ebc1b 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -13,6 +13,8 @@ static inline cycles_t get_cycles(void)
     return rdtsc_ordered();
 }
 
+s_time_t get_s_time_fixed(uint64_t at_tsc);
+
 unsigned long
 mktime (unsigned int year, unsigned int mon,
         unsigned int day, unsigned int hour,
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 6582235dcc..d339111239 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -95,7 +95,7 @@ static u32 pit_stamp32;
 static bool __read_mostly using_pit;
 
 /* Boot timestamp, filled in head.S */
-u64 __initdata boot_tsc_stamp;
+uint64_t __initdata boot_tsc_stamp;
 
 /* Per-socket TSC_ADJUST values, for secondary cores/threads to sync to. */
 static uint64_t *__read_mostly tsc_adjust;
@@ -1656,10 +1656,10 @@ static unsigned long get_wallclock_time(void)
  * System Time
  ***************************************************************************/
 
-s_time_t get_s_time_fixed(u64 at_tsc)
+s_time_t get_s_time_fixed(uint64_t at_tsc)
 {
     const struct cpu_time *t = &this_cpu(cpu_time);
-    u64 tsc, delta;
+    uint64_t tsc, delta;
 
     if ( at_tsc )
         tsc = at_tsc;
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 2185dd26a4..e9c0822e6f 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -33,7 +33,6 @@ struct vcpu;
 typedef int64_t s_time_t;
 #define PRI_stime PRId64
 
-s_time_t get_s_time_fixed(u64 at_tick);
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
 uint64_t get_localtime_us(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.