Skip to content

Commit

Permalink
fs/namei.c: fix warnings on 32-bit
Browse files Browse the repository at this point in the history
i386 allnoconfig:

  fs/namei.c: In function 'has_zero':
  fs/namei.c:1617: warning: integer constant is too large for 'unsigned long' type
  fs/namei.c:1617: warning: integer constant is too large for 'unsigned long' type
  fs/namei.c: In function 'hash_name':
  fs/namei.c:1635: warning: integer constant is too large for 'unsigned long' type

There must be a tidier way of doing this.

Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Mar 22, 2012
1 parent 1a5a990 commit 1de5b41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,9 +1455,15 @@ unsigned int full_name_hash(const unsigned char *name, unsigned int len)
}
EXPORT_SYMBOL(full_name_hash);

#ifdef CONFIG_64BIT
#define ONEBYTES 0x0101010101010101ul
#define SLASHBYTES 0x2f2f2f2f2f2f2f2ful
#define HIGHBITS 0x8080808080808080ul
#else
#define ONEBYTES 0x01010101ul
#define SLASHBYTES 0x2f2f2f2ful
#define HIGHBITS 0x80808080ul
#endif

/* Return the high bit set in the first byte that is a zero */
static inline unsigned long has_zero(unsigned long a)
Expand Down

0 comments on commit 1de5b41

Please sign in to comment.