diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 18:58:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 18:58:27 -0400 |
commit | 989412bbd2835f1475d1528846693eddbac744c8 (patch) | |
tree | 192a4fdeeca43951cc69d30fad6b91c6196f9e8c /fs/namei.c | |
parent | 1f1e6e523e43e312c0e0d38c09828d53e9f709fc (diff) |
vfs: tidy up fs/namei.c byte-repeat word constants
In commit commit 1de5b41cd3b2 ("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: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index bd313d680d34..99a34717b2b0 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1455,15 +1455,10 @@ done: | |||
1455 | } | 1455 | } |
1456 | EXPORT_SYMBOL(full_name_hash); | 1456 | EXPORT_SYMBOL(full_name_hash); |
1457 | 1457 | ||
1458 | #ifdef CONFIG_64BIT | 1458 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) |
1459 | #define ONEBYTES 0x0101010101010101ul | 1459 | #define ONEBYTES REPEAT_BYTE(0x01) |
1460 | #define SLASHBYTES 0x2f2f2f2f2f2f2f2ful | 1460 | #define SLASHBYTES REPEAT_BYTE('/') |
1461 | #define HIGHBITS 0x8080808080808080ul | 1461 | #define HIGHBITS REPEAT_BYTE(0x80) |
1462 | #else | ||
1463 | #define ONEBYTES 0x01010101ul | ||
1464 | #define SLASHBYTES 0x2f2f2f2ful | ||
1465 | #define HIGHBITS 0x80808080ul | ||
1466 | #endif | ||
1467 | 1462 | ||
1468 | /* Return the high bit set in the first byte that is a zero */ | 1463 | /* Return the high bit set in the first byte that is a zero */ |
1469 | static inline unsigned long has_zero(unsigned long a) | 1464 | static inline unsigned long has_zero(unsigned long a) |