block/iscsi:use the flags in iscsi_open() prevent Clang warning
commit34afc5c298fd4b4279aeec440603b8a1a13ab8c2
authorChen Qun <kuhn.chenqun@huawei.com>
Wed, 11 Mar 2020 03:29:27 +0000 (11 11:29 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 27 Mar 2020 13:47:23 +0000 (27 14:47 +0100)
tree39c8cfa3a8e1e735fd44b6a4836147b60ac38420
parentcfe68ae025f704f336d7dd3d1903ce37b445831d
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 <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