]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block/iscsi:use the flags in iscsi_open() prevent Clang warning
authorChen Qun <kuhn.chenqun@huawei.com>
Wed, 11 Mar 2020 03:29:27 +0000 (11:29 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 27 Mar 2020 13:47:23 +0000 (14:47 +0100)
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 <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200311032927.35092-1-kuhn.chenqun@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/iscsi.c

index 14680a436aa5f69296b8307c98cf7409870b2570..4e216bd8aa88b0877297c059730709f8f38c6a5a 100644 (file)
@@ -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);
         }
     }