Commit 0624517d809b1cf53c977335c9bda4c216cbddee

Authored by Jiri Slaby
Committed by Linus Torvalds
1 parent 1977f03272

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>

Showing 25 changed files with 102 additions and 0 deletions Side-by-side Diff

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  
include/asm-arm/bitops.h
... ... @@ -19,6 +19,10 @@
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  
include/asm-avr32/bitops.h
... ... @@ -8,6 +8,10 @@
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  
include/asm-blackfin/bitops.h
... ... @@ -11,6 +11,10 @@
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>
include/asm-cris/bitops.h
... ... @@ -14,6 +14,10 @@
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>
include/asm-frv/bitops.h
... ... @@ -21,6 +21,10 @@
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 /*
include/asm-generic/bitops.h
... ... @@ -19,6 +19,10 @@
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>
include/asm-h8300/bitops.h
... ... @@ -10,6 +10,11 @@
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 */
include/asm-ia64/bitops.h
... ... @@ -9,6 +9,10 @@
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>
include/asm-m32r/bitops.h
... ... @@ -11,6 +11,10 @@
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>
include/asm-m68k/bitops.h
... ... @@ -8,6 +8,10 @@
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 /*
include/asm-m68knommu/bitops.h
... ... @@ -10,6 +10,10 @@
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>
include/asm-mips/bitops.h
... ... @@ -9,6 +9,10 @@
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>
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>
include/asm-powerpc/bitops.h
... ... @@ -38,6 +38,10 @@
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>
include/asm-s390/bitops.h
... ... @@ -15,6 +15,10 @@
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 /*
include/asm-sh/bitops.h
... ... @@ -2,6 +2,11 @@
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>
include/asm-sh64/bitops.h
... ... @@ -13,6 +13,11 @@
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 */
include/asm-sparc/bitops.h
... ... @@ -14,6 +14,10 @@
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);
include/asm-sparc64/bitops.h
... ... @@ -7,6 +7,10 @@
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  
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
include/asm-v850/bitops.h
... ... @@ -13,6 +13,9 @@
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 */
include/asm-x86/bitops_32.h
... ... @@ -5,6 +5,10 @@
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  
include/asm-x86/bitops_64.h
... ... @@ -5,6 +5,10 @@
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)
include/asm-xtensa/bitops.h
... ... @@ -15,6 +15,10 @@
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>