Commit 3e5a5097 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

hfs: fix warning with 64k PAGE_SIZE

fs/hfs/btree.c: In function 'hfs_bmap_alloc':
fs/hfs/btree.c:263: warning: comparison is always false due to limited range of data type

The patch makes the warning go away, but the code might actually be buggy?

Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f735295b
...@@ -208,7 +208,9 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -208,7 +208,9 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
struct hfs_bnode *node, *next_node; struct hfs_bnode *node, *next_node;
struct page **pagep; struct page **pagep;
u32 nidx, idx; u32 nidx, idx;
u16 off, len; unsigned off;
u16 off16;
u16 len;
u8 *data, byte, m; u8 *data, byte, m;
int i; int i;
...@@ -235,7 +237,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -235,7 +237,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
node = hfs_bnode_find(tree, nidx); node = hfs_bnode_find(tree, nidx);
if (IS_ERR(node)) if (IS_ERR(node))
return node; return node;
len = hfs_brec_lenoff(node, 2, &off); len = hfs_brec_lenoff(node, 2, &off16);
off = off16;
off += node->page_offset; off += node->page_offset;
pagep = node->page + (off >> PAGE_CACHE_SHIFT); pagep = node->page + (off >> PAGE_CACHE_SHIFT);
...@@ -280,7 +283,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -280,7 +283,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
return next_node; return next_node;
node = next_node; node = next_node;
len = hfs_brec_lenoff(node, 0, &off); len = hfs_brec_lenoff(node, 0, &off16);
off = off16;
off += node->page_offset; off += node->page_offset;
pagep = node->page + (off >> PAGE_CACHE_SHIFT); pagep = node->page + (off >> PAGE_CACHE_SHIFT);
data = kmap(*pagep); data = kmap(*pagep);
......
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