Commit 989412bb authored by Linus Torvalds's avatar Linus Torvalds

vfs: tidy up fs/namei.c byte-repeat word constants

In commit commit 1de5b41c ("fs/namei.c: fix warnings on 32-bit")
Andrew said that there must be a tidier way of doing this.

This is that tidier way.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1f1e6e52
...@@ -1455,15 +1455,10 @@ unsigned int full_name_hash(const unsigned char *name, unsigned int len) ...@@ -1455,15 +1455,10 @@ unsigned int full_name_hash(const unsigned char *name, unsigned int len)
} }
EXPORT_SYMBOL(full_name_hash); EXPORT_SYMBOL(full_name_hash);
#ifdef CONFIG_64BIT #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
#define ONEBYTES 0x0101010101010101ul #define ONEBYTES REPEAT_BYTE(0x01)
#define SLASHBYTES 0x2f2f2f2f2f2f2f2ful #define SLASHBYTES REPEAT_BYTE('/')
#define HIGHBITS 0x8080808080808080ul #define HIGHBITS REPEAT_BYTE(0x80)
#else
#define ONEBYTES 0x01010101ul
#define SLASHBYTES 0x2f2f2f2ful
#define HIGHBITS 0x80808080ul
#endif
/* Return the high bit set in the first byte that is a zero */ /* Return the high bit set in the first byte that is a zero */
static inline unsigned long has_zero(unsigned long a) static inline unsigned long has_zero(unsigned long a)
......
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