From 34afc5c298fd4b4279aeec440603b8a1a13ab8c2 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Wed, 11 Mar 2020 11:29:27 +0800 Subject: [PATCH] block/iscsi:use the flags in iscsi_open() prevent Clang warning Clang static code analyzer show warning: block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read flags &= ~BDRV_O_RDWR; ^ ~~~~~~~~~~~~ In iscsi_allocmap_init() only checks BDRV_O_NOCACHE, which is the same in both of flags and bs->open_flags. We can use the flags instead bs->open_flags to prevent Clang warning. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Kevin Wolf Message-Id: <20200311032927.35092-1-kuhn.chenqun@huawei.com> Signed-off-by: Kevin Wolf --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index 14680a436a..4e216bd8aa 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran * iscsilun->block_size; if (iscsilun->lbprz) { - ret = iscsi_allocmap_init(iscsilun, bs->open_flags); + ret = iscsi_allocmap_init(iscsilun, flags); } } -- 2.11.4.GIT