Skip to content

Commit a55e601

Browse files
arndbidryomov
authored andcommitted
rbd: work around -Wuninitialized warning
gcc -O3 warns about a dummy variable that is passed down into rbd_img_fill_nodata without being initialized: drivers/block/rbd.c: In function 'rbd_img_fill_nodata': drivers/block/rbd.c:2573:13: error: 'dummy' is used uninitialized in this function [-Werror=uninitialized] fctx->iter = *fctx->pos; Since this is a dummy, I assume the warning is harmless, but it's better to initialize it anyway and avoid the warning. Fixes: mmtom ("init/Kconfig: enable -O3 for all arches") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Ilya Dryomov <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 9ba1e22 commit a55e601

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
@@ -2662,7 +2662,7 @@ static int rbd_img_fill_nodata(struct rbd_img_request *img_req,
26622662
u64 off, u64 len)
26632663
{
26642664
struct ceph_file_extent ex = { off, len };
2665-
union rbd_img_fill_iter dummy;
2665+
union rbd_img_fill_iter dummy = {};
26662666
struct rbd_img_fill_ctx fctx = {
26672667
.pos_type = OBJ_REQUEST_NODATA,
26682668
.pos = &dummy,

0 commit comments

Comments
 (0)