diff mbox series

[44/47] headers: Add new include/linux/bits.h

Message ID 20211019214320.2035704-45-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 5.15-rc6 | expand

Commit Message

Hauke Mehrtens Oct. 19, 2021, 9:43 p.m. UTC
With kernel 4.19 some defines from include/linux/bitops.h were extracted
to the new file include/linux/bits.h. This patch was also backported to
older stable kernel versions. This patch makes code include the
include/linux/bitops.h file on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/bits.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 backport/backport-include/linux/bits.h
diff mbox series

Patch

diff --git a/backport/backport-include/linux/bits.h b/backport/backport-include/linux/bits.h
new file mode 100644
index 00000000..db792196
--- /dev/null
+++ b/backport/backport-include/linux/bits.h
@@ -0,0 +1,14 @@ 
+#ifndef __BACKPORT_LINUX_BITS_H
+#define __BACKPORT_LINUX_BITS_H
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_GEQ(4,19,0) || \
+    LINUX_VERSION_IN_RANGE(4,14,119, 4,15,0) || \
+    LINUX_VERSION_IN_RANGE(4,9,176, 4,10,0) || \
+    LINUX_VERSION_IN_RANGE(4,4,180, 4,5,0)
+#include_next <linux/bits.h>
+#else
+#include <linux/bitops.h>
+#endif /* >= 4.19 */
+
+#endif /* __BACKPORT_LINUX_BITS_H */