summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-04-30 00:54:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:52 -0700
commit487798df6d25e76ed6558b3e17c44cf0458cc6f3 (patch)
tree3c7918f1e8e4146ab716e403daede83bbde4030a /fs
parent3e5a5097303eedb4ffae2719843eb064221b1db4 (diff)
downloadlinux-3.10-487798df6d25e76ed6558b3e17c44cf0458cc6f3.tar.gz
linux-3.10-487798df6d25e76ed6558b3e17c44cf0458cc6f3.tar.bz2
linux-3.10-487798df6d25e76ed6558b3e17c44cf0458cc6f3.zip
hfsplus: fix warning with 64k PAGE_SIZE
fs/hfsplus/btree.c: In function 'hfsplus_bmap_alloc': fs/hfsplus/btree.c:239: warning: comparison is always false due to limited range of data type But this might hide a real bug? Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/hfsplus/btree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index bb5433608a4..e49fcee1e29 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -184,7 +184,9 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
struct hfs_bnode *node, *next_node;
struct page **pagep;
u32 nidx, idx;
- u16 off, len;
+ unsigned off;
+ u16 off16;
+ u16 len;
u8 *data, byte, m;
int i;
@@ -211,7 +213,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
node = hfs_bnode_find(tree, nidx);
if (IS_ERR(node))
return node;
- len = hfs_brec_lenoff(node, 2, &off);
+ len = hfs_brec_lenoff(node, 2, &off16);
+ off = off16;
off += node->page_offset;
pagep = node->page + (off >> PAGE_CACHE_SHIFT);
@@ -256,7 +259,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
return 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;
pagep = node->page + (off >> PAGE_CACHE_SHIFT);
data = kmap(*pagep);