Commit 0624517d authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

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: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1977f032
#ifndef _ALPHA_BITOPS_H #ifndef _ALPHA_BITOPS_H
#define _ALPHA_BITOPS_H #define _ALPHA_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/compiler.h> #include <asm/compiler.h>
#include <asm/barrier.h> #include <asm/barrier.h>
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
#ifndef __ASM_AVR32_BITOPS_H #ifndef __ASM_AVR32_BITOPS_H
#define __ASM_AVR32_BITOPS_H #define __ASM_AVR32_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/__ffs.h> #include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
/* Currently this is unsuitable for consumption outside the kernel. */ /* Currently this is unsuitable for consumption outside the kernel. */
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/arch/bitops.h> #include <asm/arch/bitops.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/atomic.h> #include <asm/atomic.h>
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
/* /*
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
......
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
#include <asm/system.h> #include <asm/system.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
/* /*
* Function prototypes to keep gcc -Wall happy * Function prototypes to keep gcc -Wall happy
*/ */
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
* O(1) scheduler patch * O(1) scheduler patch
*/ */
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/intrinsics.h> #include <asm/intrinsics.h>
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
* Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
*/ */
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
* for more details. * for more details.
*/ */
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
/* /*
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/__ffs.h> #include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
#ifndef _ASM_BITOPS_H #ifndef _ASM_BITOPS_H
#define _ASM_BITOPS_H #define _ASM_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/types.h> #include <linux/types.h>
......
#ifndef _PARISC_BITOPS_H #ifndef _PARISC_BITOPS_H
#define _PARISC_BITOPS_H #define _PARISC_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */ #include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */
#include <asm/byteorder.h> #include <asm/byteorder.h>
......
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/asm-compat.h> #include <asm/asm-compat.h>
#include <asm/synch.h> #include <asm/synch.h>
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
/* /*
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
#define __ASM_SH_BITOPS_H #define __ASM_SH_BITOPS_H
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/system.h> #include <asm/system.h>
/* For __swab32 */ /* For __swab32 */
#include <asm/byteorder.h> #include <asm/byteorder.h>
......
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
*/ */
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/system.h> #include <asm/system.h>
/* For __swab32 */ /* For __swab32 */
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask);
extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask);
extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask); extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask);
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
#ifndef _SPARC64_BITOPS_H #ifndef _SPARC64_BITOPS_H
#define _SPARC64_BITOPS_H #define _SPARC64_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
......
#ifndef __UM_BITOPS_H #ifndef __UM_BITOPS_H
#define __UM_BITOPS_H #define __UM_BITOPS_H
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include "asm/arch/bitops.h" #include "asm/arch/bitops.h"
#endif #endif
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
#ifndef __V850_BITOPS_H__ #ifndef __V850_BITOPS_H__
#define __V850_BITOPS_H__ #define __V850_BITOPS_H__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> /* unlikely */ #include <linux/compiler.h> /* unlikely */
#include <asm/byteorder.h> /* swab32 */ #include <asm/byteorder.h> /* swab32 */
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* Copyright 1992, Linus Torvalds. * Copyright 1992, Linus Torvalds.
*/ */
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/alternative.h> #include <asm/alternative.h>
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* Copyright 1992, Linus Torvalds. * Copyright 1992, Linus Torvalds.
*/ */
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/alternative.h> #include <asm/alternative.h>
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly
#endif
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/system.h> #include <asm/system.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment