* [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush
@ 2017-04-26 2:03 Fam Zheng
2017-04-26 14:32 ` Max Reitz
2017-04-26 15:20 ` Kevin Wolf
0 siblings, 2 replies; 3+ messages in thread
From: Fam Zheng @ 2017-04-26 2:03 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-block, Fam Zheng, Kevin Wolf, Max Reitz, Stefan Hajnoczi
Reported by Coverity. We already use bs in bdrv_inc_in_flight before
checking for NULL. It is unnecessary as all callers pass non-NULL bs, so
drop it.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
block/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index a7142e0..a039966 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2308,7 +2308,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
bdrv_inc_in_flight(bs);
- if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs) ||
+ if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs) ||
bdrv_is_sg(bs)) {
goto early_exit;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush
2017-04-26 2:03 [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush Fam Zheng
@ 2017-04-26 14:32 ` Max Reitz
2017-04-26 15:20 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Max Reitz @ 2017-04-26 14:32 UTC (permalink / raw)
To: Fam Zheng, qemu-devel; +Cc: qemu-block, Kevin Wolf, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
On 26.04.2017 04:03, Fam Zheng wrote:
> Reported by Coverity. We already use bs in bdrv_inc_in_flight before
> checking for NULL. It is unnecessary as all callers pass non-NULL bs, so
> drop it.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block/io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush
2017-04-26 2:03 [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush Fam Zheng
2017-04-26 14:32 ` Max Reitz
@ 2017-04-26 15:20 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2017-04-26 15:20 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel, qemu-block, Max Reitz, Stefan Hajnoczi
Am 26.04.2017 um 04:03 hat Fam Zheng geschrieben:
> Reported by Coverity. We already use bs in bdrv_inc_in_flight before
> checking for NULL. It is unnecessary as all callers pass non-NULL bs, so
> drop it.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
Thanks, applied to block-next.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-26 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 2:03 [Qemu-devel] [PATCH] block: Remove NULL check in bdrv_co_flush Fam Zheng
2017-04-26 14:32 ` Max Reitz
2017-04-26 15:20 ` Kevin Wolf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.