From: Jens Axboe Date: Thu, 22 Jun 2017 20:12:29 +0000 (-0600) Subject: arch: tsc_reliable can be a bool X-Git-Tag: fio-2.99~70 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=24575392bff8bdb9ec7709a78b4fbd48367fc1f5;p=fio.git arch: tsc_reliable can be a bool Signed-off-by: Jens Axboe --- diff --git a/arch/arch-ia64.h b/arch/arch-ia64.h index 53c049fd..ece3f7e2 100644 --- a/arch/arch-ia64.h +++ b/arch/arch-ia64.h @@ -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; } diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h index 4a8aa97c..ba452b15 100644 --- a/arch/arch-ppc.h +++ b/arch/arch-ppc.h @@ -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; diff --git a/arch/arch-s390.h b/arch/arch-s390.h index 2e84bf8a..6bf033b0 100644 --- a/arch/arch-s390.h +++ b/arch/arch-s390.h @@ -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; } diff --git a/arch/arch-x86-common.h b/arch/arch-x86-common.h index cbf66b8d..c51c04c2 100644 --- a/arch/arch-x86-common.h +++ b/arch/arch-x86-common.h @@ -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) diff --git a/arch/arch.h b/arch/arch.h index 00d247c4..4fb9b518 100644 --- a/arch/arch.h +++ b/arch/arch.h @@ -1,6 +1,8 @@ #ifndef ARCH_H #define ARCH_H +#include "../lib/types.h" + enum { arch_x86_64 = 1, arch_x86, diff --git a/gettime.c b/gettime.c index a14a179b..5741932f 100644 --- 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 diff --git a/t/arch.c b/t/arch.c index befb7c7f..bd28a848 100644 --- 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;