Skip to content

Commit 633739b

Browse files
committed
rbd: silence bogus uninitialized warning in rbd_object_map_update_finish()
Some versions of gcc (so far 6.3 and 7.4) throw a warning: drivers/block/rbd.c: In function 'rbd_object_map_callback': drivers/block/rbd.c:2124:21: warning: 'current_state' may be used uninitialized in this function [-Wmaybe-uninitialized] (current_state == OBJECT_EXISTS && state == OBJECT_EXISTS_CLEAN)) drivers/block/rbd.c:2092:23: note: 'current_state' was declared here u8 state, new_state, current_state; ^~~~~~~~~~~~~ It's bogus because all current_state accesses are guarded by has_current_state. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]> Reviewed-by: Dongsheng Yang <[email protected]>
1 parent 6a81749 commit 633739b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ static int rbd_object_map_update_finish(struct rbd_obj_request *obj_req,
20872087
struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev;
20882088
struct ceph_osd_data *osd_data;
20892089
u64 objno;
2090-
u8 state, new_state, current_state;
2090+
u8 state, new_state, uninitialized_var(current_state);
20912091
bool has_current_state;
20922092
void *p;
20932093

0 commit comments

Comments
 (0)