@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_BITMAP_H
#define __LINUX_BITMAP_H
+#define __LINUX_INSIDE_BITMAP_H
#ifndef __ASSEMBLY__
@@ -831,4 +832,5 @@ void bitmap_write(unsigned long *map, unsigned long value,
#endif /* __ASSEMBLY__ */
+#undef __LINUX_INSIDE_BITMAP_H
#endif /* __LINUX_BITMAP_H */
@@ -1,11 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_INSIDE_BITMAP_H
+#error "only <linux/bitmap.h> can be included directly"
+#endif
+
#ifndef __LINUX_FIND_H_
#define __LINUX_FIND_H_
-#ifndef __LINUX_BITMAP_H
-#error only <linux/bitmap.h> can be included directly
-#endif
-
#include <linux/bitops.h>
unsigned long _find_next_bit(const unsigned long *addr1, unsigned long nbits,
The check to bail out if 'find.h' is included instead of 'bitmap.h' is weak. It fails if 'bitmap.h' is included before 'find.h'. So, introduce a specific define just for this check. Put the error string in quotes while here. To avoid build regressions, all faulty includes have been fixed before. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- Here is my promised patch from the discusson at [1]. Buildbot is happy with it. [1] https://lore.kernel.org/r/Z2Goxx27WL-G-13y@google.com include/linux/bitmap.h | 2 ++ include/linux/find.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-)