Skip to content

Commit

Permalink
kernel: Move REPEAT_BYTE definition into linux/kernel.h
Browse files Browse the repository at this point in the history
And make sure that everything using it explicitly includes
that header file.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 24, 2012
1 parent 35c9646 commit 4469690
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions arch/sparc/lib/usercopy.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/bug.h>

Expand All @@ -11,8 +12,6 @@ void copy_from_user_overflow(void)
}
EXPORT_SYMBOL(copy_from_user_overflow);

#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))

static inline long find_zero(unsigned long mask)
{
long byte = 0;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/word-at-a-time.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _ASM_WORD_AT_A_TIME_H
#define _ASM_WORD_AT_A_TIME_H

#include <linux/kernel.h>

/*
* This is largely generic for little-endian machines, but the
* optimal byte mask counting is probably going to be something
Expand Down Expand Up @@ -35,8 +37,6 @@ static inline long count_masked_bytes(long mask)

#endif

#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))

/* Return the high bit set in the first byte that is a zero */
static inline unsigned long has_zero(unsigned long a)
{
Expand Down
1 change: 1 addition & 0 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <linux/init.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/namei.h>
Expand Down
2 changes: 2 additions & 0 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#define STACK_MAGIC 0xdeadbeef

#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))

#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
Expand Down

0 comments on commit 4469690

Please sign in to comment.