diff mbox series

[v2,kvmtool,02/10] bitops.h: Include wordsize.h to provide the __WORDSIZE define

Message ID 20220127162033.54290-3-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: Improve PMU support on heterogeneous systems | expand

Commit Message

Alexandru Elisei Jan. 27, 2022, 4:20 p.m. UTC
Trying to build a source file which included bitops.h, but didn't also
bring in the definition for __WORDSIZE (by including limits.h, for example)
would result in the following error:

include/linux/bitops.h:8:23: error: ‘__WORDSIZE’ undeclared (first use in this function)
    8 | #define BITS_PER_LONG __WORDSIZE
      |                       ^~~~~~~~~~

The symbol is defined in the bits/wordsize.h header file, include it.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 include/linux/bitops.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 56448b71ebbf..3d31f0acf48e 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -1,6 +1,8 @@ 
 #ifndef _KVM_LINUX_BITOPS_H_
 #define _KVM_LINUX_BITOPS_H_
 
+#include <bits/wordsize.h>
+
 #include <linux/kernel.h>
 #include <linux/compiler.h>
 #include <asm/hweight.h>