Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

forbid asm/bitops.h direct inclusion

forbid asm/bitops.h direct inclusion

Because of compile errors that may occur after bit changes if asm/bitops.h is
included directly without e.g. linux/kernel.h which includes linux/bitops.h,
forbid direct inclusion of asm/bitops.h. Thanks to Adrian Bunk.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jiri Slaby and committed by
Linus Torvalds
0624517d 1977f032

+102
+4
include/asm-alpha/bitops.h
··· 1 1 #ifndef _ALPHA_BITOPS_H 2 2 #define _ALPHA_BITOPS_H 3 3 4 + #ifndef _LINUX_BITOPS_H 5 + #error only <linux/bitops.h> can be included directly 6 + #endif 7 + 4 8 #include <asm/compiler.h> 5 9 #include <asm/barrier.h> 6 10
+4
include/asm-arm/bitops.h
··· 19 19 20 20 #ifdef __KERNEL__ 21 21 22 + #ifndef _LINUX_BITOPS_H 23 + #error only <linux/bitops.h> can be included directly 24 + #endif 25 + 22 26 #include <linux/compiler.h> 23 27 #include <asm/system.h> 24 28
+4
include/asm-avr32/bitops.h
··· 8 8 #ifndef __ASM_AVR32_BITOPS_H 9 9 #define __ASM_AVR32_BITOPS_H 10 10 11 + #ifndef _LINUX_BITOPS_H 12 + #error only <linux/bitops.h> can be included directly 13 + #endif 14 + 11 15 #include <asm/byteorder.h> 12 16 #include <asm/system.h> 13 17
+4
include/asm-blackfin/bitops.h
··· 11 11 12 12 #ifdef __KERNEL__ 13 13 14 + #ifndef _LINUX_BITOPS_H 15 + #error only <linux/bitops.h> can be included directly 16 + #endif 17 + 14 18 #include <asm-generic/bitops/ffs.h> 15 19 #include <asm-generic/bitops/__ffs.h> 16 20 #include <asm-generic/bitops/sched.h>
+4
include/asm-cris/bitops.h
··· 14 14 /* Currently this is unsuitable for consumption outside the kernel. */ 15 15 #ifdef __KERNEL__ 16 16 17 + #ifndef _LINUX_BITOPS_H 18 + #error only <linux/bitops.h> can be included directly 19 + #endif 20 + 17 21 #include <asm/arch/bitops.h> 18 22 #include <asm/system.h> 19 23 #include <asm/atomic.h>
+4
include/asm-frv/bitops.h
··· 21 21 22 22 #ifdef __KERNEL__ 23 23 24 + #ifndef _LINUX_BITOPS_H 25 + #error only <linux/bitops.h> can be included directly 26 + #endif 27 + 24 28 #include <asm-generic/bitops/ffz.h> 25 29 26 30 /*
+4
include/asm-generic/bitops.h
··· 19 19 20 20 #ifdef __KERNEL__ 21 21 22 + #ifndef _LINUX_BITOPS_H 23 + #error only <linux/bitops.h> can be included directly 24 + #endif 25 + 22 26 #include <asm-generic/bitops/sched.h> 23 27 #include <asm-generic/bitops/ffs.h> 24 28 #include <asm-generic/bitops/hweight.h>
+5
include/asm-h8300/bitops.h
··· 10 10 #include <asm/system.h> 11 11 12 12 #ifdef __KERNEL__ 13 + 14 + #ifndef _LINUX_BITOPS_H 15 + #error only <linux/bitops.h> can be included directly 16 + #endif 17 + 13 18 /* 14 19 * Function prototypes to keep gcc -Wall happy 15 20 */
+4
include/asm-ia64/bitops.h
··· 9 9 * O(1) scheduler patch 10 10 */ 11 11 12 + #ifndef _LINUX_BITOPS_H 13 + #error only <linux/bitops.h> can be included directly 14 + #endif 15 + 12 16 #include <linux/compiler.h> 13 17 #include <linux/types.h> 14 18 #include <asm/intrinsics.h>
+4
include/asm-m32r/bitops.h
··· 11 11 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 12 12 */ 13 13 14 + #ifndef _LINUX_BITOPS_H 15 + #error only <linux/bitops.h> can be included directly 16 + #endif 17 + 14 18 #include <linux/compiler.h> 15 19 #include <asm/assembler.h> 16 20 #include <asm/system.h>
+4
include/asm-m68k/bitops.h
··· 8 8 * for more details. 9 9 */ 10 10 11 + #ifndef _LINUX_BITOPS_H 12 + #error only <linux/bitops.h> can be included directly 13 + #endif 14 + 11 15 #include <linux/compiler.h> 12 16 13 17 /*
+4
include/asm-m68knommu/bitops.h
··· 10 10 11 11 #ifdef __KERNEL__ 12 12 13 + #ifndef _LINUX_BITOPS_H 14 + #error only <linux/bitops.h> can be included directly 15 + #endif 16 + 13 17 #include <asm-generic/bitops/ffs.h> 14 18 #include <asm-generic/bitops/__ffs.h> 15 19 #include <asm-generic/bitops/sched.h>
+4
include/asm-mips/bitops.h
··· 9 9 #ifndef _ASM_BITOPS_H 10 10 #define _ASM_BITOPS_H 11 11 12 + #ifndef _LINUX_BITOPS_H 13 + #error only <linux/bitops.h> can be included directly 14 + #endif 15 + 12 16 #include <linux/compiler.h> 13 17 #include <linux/irqflags.h> 14 18 #include <linux/types.h>
+4
include/asm-parisc/bitops.h
··· 1 1 #ifndef _PARISC_BITOPS_H 2 2 #define _PARISC_BITOPS_H 3 3 4 + #ifndef _LINUX_BITOPS_H 5 + #error only <linux/bitops.h> can be included directly 6 + #endif 7 + 4 8 #include <linux/compiler.h> 5 9 #include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */ 6 10 #include <asm/byteorder.h>
+4
include/asm-powerpc/bitops.h
··· 38 38 39 39 #ifdef __KERNEL__ 40 40 41 + #ifndef _LINUX_BITOPS_H 42 + #error only <linux/bitops.h> can be included directly 43 + #endif 44 + 41 45 #include <linux/compiler.h> 42 46 #include <asm/asm-compat.h> 43 47 #include <asm/synch.h>
+4
include/asm-s390/bitops.h
··· 15 15 16 16 #ifdef __KERNEL__ 17 17 18 + #ifndef _LINUX_BITOPS_H 19 + #error only <linux/bitops.h> can be included directly 20 + #endif 21 + 18 22 #include <linux/compiler.h> 19 23 20 24 /*
+5
include/asm-sh/bitops.h
··· 2 2 #define __ASM_SH_BITOPS_H 3 3 4 4 #ifdef __KERNEL__ 5 + 6 + #ifndef _LINUX_BITOPS_H 7 + #error only <linux/bitops.h> can be included directly 8 + #endif 9 + 5 10 #include <asm/system.h> 6 11 /* For __swab32 */ 7 12 #include <asm/byteorder.h>
+5
include/asm-sh64/bitops.h
··· 13 13 */ 14 14 15 15 #ifdef __KERNEL__ 16 + 17 + #ifndef _LINUX_BITOPS_H 18 + #error only <linux/bitops.h> can be included directly 19 + #endif 20 + 16 21 #include <linux/compiler.h> 17 22 #include <asm/system.h> 18 23 /* For __swab32 */
+4
include/asm-sparc/bitops.h
··· 14 14 15 15 #ifdef __KERNEL__ 16 16 17 + #ifndef _LINUX_BITOPS_H 18 + #error only <linux/bitops.h> can be included directly 19 + #endif 20 + 17 21 extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); 18 22 extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); 19 23 extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask);
+4
include/asm-sparc64/bitops.h
··· 7 7 #ifndef _SPARC64_BITOPS_H 8 8 #define _SPARC64_BITOPS_H 9 9 10 + #ifndef _LINUX_BITOPS_H 11 + #error only <linux/bitops.h> can be included directly 12 + #endif 13 + 10 14 #include <linux/compiler.h> 11 15 #include <asm/byteorder.h> 12 16
+4
include/asm-um/bitops.h
··· 1 1 #ifndef __UM_BITOPS_H 2 2 #define __UM_BITOPS_H 3 3 4 + #ifndef _LINUX_BITOPS_H 5 + #error only <linux/bitops.h> can be included directly 6 + #endif 7 + 4 8 #include "asm/arch/bitops.h" 5 9 6 10 #endif
+3
include/asm-v850/bitops.h
··· 13 13 #ifndef __V850_BITOPS_H__ 14 14 #define __V850_BITOPS_H__ 15 15 16 + #ifndef _LINUX_BITOPS_H 17 + #error only <linux/bitops.h> can be included directly 18 + #endif 16 19 17 20 #include <linux/compiler.h> /* unlikely */ 18 21 #include <asm/byteorder.h> /* swab32 */
+4
include/asm-x86/bitops_32.h
··· 5 5 * Copyright 1992, Linus Torvalds. 6 6 */ 7 7 8 + #ifndef _LINUX_BITOPS_H 9 + #error only <linux/bitops.h> can be included directly 10 + #endif 11 + 8 12 #include <linux/compiler.h> 9 13 #include <asm/alternative.h> 10 14
+4
include/asm-x86/bitops_64.h
··· 5 5 * Copyright 1992, Linus Torvalds. 6 6 */ 7 7 8 + #ifndef _LINUX_BITOPS_H 9 + #error only <linux/bitops.h> can be included directly 10 + #endif 11 + 8 12 #include <asm/alternative.h> 9 13 10 14 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
+4
include/asm-xtensa/bitops.h
··· 15 15 16 16 #ifdef __KERNEL__ 17 17 18 + #ifndef _LINUX_BITOPS_H 19 + #error only <linux/bitops.h> can be included directly 20 + #endif 21 + 18 22 #include <asm/processor.h> 19 23 #include <asm/byteorder.h> 20 24 #include <asm/system.h>