Fio 2.1.13
[fio.git] / os / os.h
diff --git a/os/os.h b/os/os.h
index 2f2d06981bdb0cbbdba24e52771551b2ed8a9fbc..df706ab7be4150d8589b2130e96e5c4ef1b09bb6 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -200,22 +200,31 @@ static inline uint64_t fio_swap64(uint64_t val)
 #endif
 #endif /* FIO_HAVE_BYTEORDER_FUNCS */
 
+#ifdef FIO_INTERNAL
 #define le16_to_cpu(val) ({                    \
+       typecheck(uint16_t, val);               \
        __le16_to_cpu(val);                     \
 })
 #define le32_to_cpu(val) ({                    \
+       typecheck(uint32_t, val);               \
        __le32_to_cpu(val);                     \
 })
 #define le64_to_cpu(val) ({                    \
-       __le64_to_cpu(val);                             \
+       typecheck(uint64_t, val);               \
+       __le64_to_cpu(val);                     \
 })
+#endif
+
 #define cpu_to_le16(val) ({                    \
+       typecheck(uint16_t, val);               \
        __cpu_to_le16(val);                     \
 })
 #define cpu_to_le32(val) ({                    \
+       typecheck(uint32_t, val);               \
        __cpu_to_le32(val);                     \
 })
 #define cpu_to_le64(val) ({                    \
+       typecheck(uint64_t, val);               \
        __cpu_to_le64(val);                     \
 })
 
@@ -321,7 +330,7 @@ static inline unsigned int cpus_online(void)
 }
 #endif
 
-#ifndef CONFIG_CPU_COUNT
+#ifndef CPU_COUNT
 #ifdef FIO_HAVE_CPU_AFFINITY
 static inline int CPU_COUNT(os_cpu_mask_t *mask)
 {