[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/6] block/iscsi:use the flags in iscsi_open() prevent Clang warni
From: |
Kevin Wolf |
Subject: |
[PULL 1/6] block/iscsi:use the flags in iscsi_open() prevent Clang warning |
Date: |
Fri, 27 Mar 2020 16:19:45 +0100 |
From: Chen Qun <address@hidden>
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 <address@hidden>
Signed-off-by: Chen Qun <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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.20.1
- [PULL 0/6] Block layer patches, Kevin Wolf, 2020/03/27
- [PULL 2/6] block: fix bdrv_root_attach_child forget to unref child_bs, Kevin Wolf, 2020/03/27
- [PULL 1/6] block/iscsi:use the flags in iscsi_open() prevent Clang warning,
Kevin Wolf <=
- [PULL 3/6] nvme: Print 'cqid' for nvme_del_cq, Kevin Wolf, 2020/03/27
- [PULL 4/6] Revert "mirror: Don't let an operation wait for itself", Kevin Wolf, 2020/03/27
- [PULL 5/6] mirror: Wait only for in-flight operations, Kevin Wolf, 2020/03/27
- [PULL 6/6] qcow2: Remove unused fields from BDRVQcow2State, Kevin Wolf, 2020/03/27
- Re: [PULL 0/6] Block layer patches, Peter Maydell, 2020/03/27