diff options
author | Vyacheslav Dubeyko <slava@dubeyko.com> | 2013-04-30 18:27:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:05 -0400 |
commit | 5f3726f9457d5a863721353786e3395cdbd0f943 (patch) | |
tree | 0be17a6738b983b51c44a762d44a25727fa7843b /fs/hfsplus | |
parent | 9509f17851da294f8ecf0fc0bfe0fe609671352d (diff) |
hfsplus: fix warnings in fs/hfsplus/bfind.c
fs/hfsplus/bfind.c: In function 'hfs_find_1st_rec_by_cnid':
(1) include/uapi/linux/swab.h:60:2: warning: 'search_cnid' may be used uninitialized in this function [-Wmaybe-uninitialized]
(2) include/uapi/linux/swab.h:60:2: warning: 'cur_cnid' may be used uninitialized in this function [-Wmaybe-uninitialized]
[akpm@linux-foundation.org: make the workaround more explicit]
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/bfind.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c index d73c98d1ee99..bbfdc1707725 100644 --- a/fs/hfsplus/bfind.c +++ b/fs/hfsplus/bfind.c | |||
@@ -56,7 +56,8 @@ int hfs_find_1st_rec_by_cnid(struct hfs_bnode *bnode, | |||
56 | int *end, | 56 | int *end, |
57 | int *cur_rec) | 57 | int *cur_rec) |
58 | { | 58 | { |
59 | __be32 cur_cnid, search_cnid; | 59 | __be32 cur_cnid; |
60 | __be32 search_cnid; | ||
60 | 61 | ||
61 | if (bnode->tree->cnid == HFSPLUS_EXT_CNID) { | 62 | if (bnode->tree->cnid == HFSPLUS_EXT_CNID) { |
62 | cur_cnid = fd->key->ext.cnid; | 63 | cur_cnid = fd->key->ext.cnid; |
@@ -67,8 +68,11 @@ int hfs_find_1st_rec_by_cnid(struct hfs_bnode *bnode, | |||
67 | } else if (bnode->tree->cnid == HFSPLUS_ATTR_CNID) { | 68 | } else if (bnode->tree->cnid == HFSPLUS_ATTR_CNID) { |
68 | cur_cnid = fd->key->attr.cnid; | 69 | cur_cnid = fd->key->attr.cnid; |
69 | search_cnid = fd->search_key->attr.cnid; | 70 | search_cnid = fd->search_key->attr.cnid; |
70 | } else | 71 | } else { |
72 | cur_cnid = 0; /* used-uninitialized warning */ | ||
73 | search_cnid = 0; | ||
71 | BUG(); | 74 | BUG(); |
75 | } | ||
72 | 76 | ||
73 | if (cur_cnid == search_cnid) { | 77 | if (cur_cnid == search_cnid) { |
74 | (*end) = (*cur_rec); | 78 | (*end) = (*cur_rec); |