arch: tsc_reliable can be a bool
authorJens Axboe <axboe@kernel.dk>
Thu, 22 Jun 2017 20:12:29 +0000 (14:12 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Jun 2017 20:12:29 +0000 (14:12 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/arch-ia64.h
arch/arch-ppc.h
arch/arch-s390.h
arch/arch-x86-common.h
arch/arch.h
gettime.c
t/arch.c

index 53c049fdf1866f11f4ddd517a8b9deaa2326dcc4..ece3f7e2291c7dbfc20f88eeb035fdbe8ddf332e 100644 (file)
@@ -28,10 +28,10 @@ static inline unsigned long long get_cpu_clock(void)
 }
 
 #define ARCH_HAVE_INIT
-extern int tsc_reliable;
+extern bool tsc_reliable;
 static inline int arch_init(char *envp[])
 {
-       tsc_reliable = 1;
+       tsc_reliable = true;
        return 0;
 }
 
index 4a8aa97c4d9dbc01bd427e6c49e10fefbe5c41ac..ba452b15b1fff30e92e62820b1301ab42cf100ed 100644 (file)
@@ -117,12 +117,12 @@ static void atb_clocktest(void)
 #endif
 
 #define ARCH_HAVE_INIT
-extern int tsc_reliable;
+extern bool tsc_reliable;
 
 static inline int arch_init(char *envp[])
 {
 #if 0
-       tsc_reliable = 1;
+       tsc_reliable = true;
        atb_clocktest();
 #endif
        return 0;
index 2e84bf8ad45744ec6d74c7ed09918d83565f9c32..6bf033b00a84d4208ec5f83a0b084d5cf961ed07 100644 (file)
@@ -28,10 +28,10 @@ static inline unsigned long long get_cpu_clock(void)
 #undef ARCH_CPU_CLOCK_WRAPS
 
 #define ARCH_HAVE_INIT
-extern int tsc_reliable;
+extern bool tsc_reliable;
 static inline int arch_init(char *envp[])
 {
-       tsc_reliable = 1;
+       tsc_reliable = true;
        return 0;
 }
 
index cbf66b8d04c18c63566dadff2d06e40a90fd8f69..c51c04c2d1b5f3a9958092ba05e468307e3cc42d 100644 (file)
@@ -14,7 +14,7 @@ static inline void cpuid(unsigned int op,
 
 #define ARCH_HAVE_INIT
 
-extern int tsc_reliable;
+extern bool tsc_reliable;
 extern int arch_random;
 
 static inline void arch_init_intel(unsigned int level)
index 00d247c4ca44216a096f9a5f292b488093ab6378..4fb9b518085aeeae06a390874ee35346ad5ef9b7 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef ARCH_H
 #define ARCH_H
 
+#include "../lib/types.h"
+
 enum {
        arch_x86_64 = 1,
        arch_x86,
index a14a179bd14e49bc47e5fdb0f118a40ac7edbe0e..5741932f283ccc8edf8c262b581e9adf936dba2b 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -28,7 +28,7 @@ static unsigned int max_cycles_shift;
 static unsigned int cycles_wrap;
 #endif
 #endif
-int tsc_reliable = 0;
+bool tsc_reliable = false;
 
 struct tv_valid {
        int warned;
@@ -413,7 +413,7 @@ void fio_clock_init(void)
        fio_clock_source_inited = fio_clock_source;
 
        if (calibrate_cpu_clock())
-               tsc_reliable = 0;
+               tsc_reliable = false;
 
        /*
         * If the arch sets tsc_reliable != 0, then it must be good enough
index befb7c7f00cb56effdfa6e8fd4405e9bb653210f..bd28a848b20152e9a53777e3f7bd58d92c06f62f 100644 (file)
--- a/t/arch.c
+++ b/t/arch.c
@@ -1,5 +1,5 @@
 #include "../arch/arch.h"
 
 unsigned long arch_flags = 0;
-int tsc_reliable;
+bool tsc_reliable;
 int arch_random;