diff mbox series

[for_v25,2/4] x86/sgx: Add missing linux/bits.h include in sgx/arch.h

Message ID 20191220225501.23476-3-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series selftests/x86: x86/sgx: Minor selftest cleanup | expand

Commit Message

Sean Christopherson Dec. 20, 2019, 10:54 p.m. UTC
Include linux/bits.h for its defitions of BIT() and GENMASK*().

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/arch.h            |  1 +
 tools/testing/selftests/x86/sgx/defines.h | 22 ----------------------
 2 files changed, 1 insertion(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/arch.h b/arch/x86/kernel/cpu/sgx/arch.h
index 7a5d24b4d1bb..dbd652be9b53 100644
--- a/arch/x86/kernel/cpu/sgx/arch.h
+++ b/arch/x86/kernel/cpu/sgx/arch.h
@@ -8,6 +8,7 @@ 
 #ifndef _ASM_X86_SGX_ARCH_H
 #define _ASM_X86_SGX_ARCH_H
 
+#include <linux/bits.h>
 #include <linux/types.h>
 
 #define SGX_CPUID				0x12
diff --git a/tools/testing/selftests/x86/sgx/defines.h b/tools/testing/selftests/x86/sgx/defines.h
index 1e67f2f29f42..87264f85cb9f 100644
--- a/tools/testing/selftests/x86/sgx/defines.h
+++ b/tools/testing/selftests/x86/sgx/defines.h
@@ -8,31 +8,9 @@ 
 
 #include <stdint.h>
 
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
 #define __aligned(x) __attribute__((__aligned__(x)))
 #define __packed __attribute__((packed))
 
-/* Derived from asm-generic/bitsperlong.h. */
-#if __x86_64__
-#define BITS_PER_LONG 64
-#else
-#define BITS_PER_LONG 32
-#endif
-#define BITS_PER_LONG_LONG 64
-
-/* Taken from linux/bits.h. */
-#define BIT(nr)	(1UL << (nr))
-#define BIT_ULL(nr) (1ULL << (nr))
-#define GENMASK(h, l) \
-	(((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
-#define GENMASK_ULL(h, l) \
-	(((~0ULL) - (1ULL << (l)) + 1) & \
-	 (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
-
 #include "../../../../../arch/x86/kernel/cpu/sgx/arch.h"
 #include "../../../../../arch/x86/include/uapi/asm/sgx.h"