diff mbox series

[v3,kvmtool,02/11] linux/bitops.h: Include wordsize.h to provide the __WORDSIZE define

Message ID 20220412133231.35355-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 April 12, 2022, 1:32 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>