Commit 446969084d33a4064a39d280806da642c54ba4ac

Authored by David S. Miller
1 parent 35c9646062

kernel: Move REPEAT_BYTE definition into linux/kernel.h

And make sure that everything using it explicitly includes
that header file.

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 4 changed files with 6 additions and 4 deletions Side-by-side Diff

arch/sparc/lib/usercopy.c
1 1 #include <linux/module.h>
2 2 #include <linux/uaccess.h>
  3 +#include <linux/kernel.h>
3 4 #include <linux/errno.h>
4 5 #include <linux/bug.h>
5 6  
... ... @@ -10,8 +11,6 @@
10 11 WARN(1, "Buffer overflow detected!\n");
11 12 }
12 13 EXPORT_SYMBOL(copy_from_user_overflow);
13   -
14   -#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
15 14  
16 15 static inline long find_zero(unsigned long mask)
17 16 {
arch/x86/include/asm/word-at-a-time.h
1 1 #ifndef _ASM_WORD_AT_A_TIME_H
2 2 #define _ASM_WORD_AT_A_TIME_H
3 3  
  4 +#include <linux/kernel.h>
  5 +
4 6 /*
5 7 * This is largely generic for little-endian machines, but the
6 8 * optimal byte mask counting is probably going to be something
... ... @@ -34,8 +36,6 @@
34 36 }
35 37  
36 38 #endif
37   -
38   -#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
39 39  
40 40 /* Return the high bit set in the first byte that is a zero */
41 41 static inline unsigned long has_zero(unsigned long a)
... ... @@ -16,6 +16,7 @@
16 16  
17 17 #include <linux/init.h>
18 18 #include <linux/export.h>
  19 +#include <linux/kernel.h>
19 20 #include <linux/slab.h>
20 21 #include <linux/fs.h>
21 22 #include <linux/namei.h>
include/linux/kernel.h
... ... @@ -38,6 +38,8 @@
38 38  
39 39 #define STACK_MAGIC 0xdeadbeef
40 40  
  41 +#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
  42 +
41 43 #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
42 44 #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
43 45 #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))