Skip to content

Commit 8e298de

Browse files
Jia Yangidryomov
authored andcommitted
ceph: remove unused variables in ceph_mdsmap_decode()
Fix build warnings: fs/ceph/mdsmap.c: In function ‘ceph_mdsmap_decode’: fs/ceph/mdsmap.c:192:7: warning: variable ‘info_cv’ set but not used [-Wunused-but-set-variable] fs/ceph/mdsmap.c:177:7: warning: variable ‘state_seq’ set but not used [-Wunused-but-set-variable] fs/ceph/mdsmap.c:123:15: warning: variable ‘mdsmap_cv’ set but not used [-Wunused-but-set-variable] Note that p is increased in ceph_decode_*. Signed-off-by: Jia Yang <jiayang5@huawei.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent f1f565a commit 8e298de

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

fs/ceph/mdsmap.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
120120
const void *start = *p;
121121
int i, j, n;
122122
int err;
123-
u8 mdsmap_v, mdsmap_cv;
123+
u8 mdsmap_v;
124124
u16 mdsmap_ev;
125125

126126
m = kzalloc(sizeof(*m), GFP_NOFS);
@@ -129,7 +129,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
129129

130130
ceph_decode_need(p, end, 1 + 1, bad);
131131
mdsmap_v = ceph_decode_8(p);
132-
mdsmap_cv = ceph_decode_8(p);
132+
*p += sizeof(u8); /* mdsmap_cv */
133133
if (mdsmap_v >= 4) {
134134
u32 mdsmap_len;
135135
ceph_decode_32_safe(p, end, mdsmap_len, bad);
@@ -174,7 +174,6 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
174174
u64 global_id;
175175
u32 namelen;
176176
s32 mds, inc, state;
177-
u64 state_seq;
178177
u8 info_v;
179178
void *info_end = NULL;
180179
struct ceph_entity_addr addr;
@@ -189,9 +188,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
189188
info_v= ceph_decode_8(p);
190189
if (info_v >= 4) {
191190
u32 info_len;
192-
u8 info_cv;
193191
ceph_decode_need(p, end, 1 + sizeof(u32), bad);
194-
info_cv = ceph_decode_8(p);
192+
*p += sizeof(u8); /* info_cv */
195193
info_len = ceph_decode_32(p);
196194
info_end = *p + info_len;
197195
if (info_end > end)
@@ -210,7 +208,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
210208
mds = ceph_decode_32(p);
211209
inc = ceph_decode_32(p);
212210
state = ceph_decode_32(p);
213-
state_seq = ceph_decode_64(p);
211+
*p += sizeof(u64); /* state_seq */
214212
err = ceph_decode_entity_addr(p, end, &addr);
215213
if (err)
216214
goto corrupt;

0 commit comments

Comments
 (0)