nbd: Drop dead code spotted by Coverity
PATCH 1/1 nbd: Drop dead code spotted by Coverity
CID 1488362 points out that the second 'rc >= 0' check is now dead code.
--- block/nbd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
block/nbd.c +2 -6
@@ -521,12 +521,8 @@ static int coroutine_fn nbd_co_send_request(BlockDriverState *bs,if (qiov) {qio_channel_set_cork (s->ioc, true); rc =nbd_send_request (s->ioc, request); -if (rc >=0 ) { -if (qio_channel_writev_all (s->ioc, qiov->iov, qiov->niov, -NULL ) <0 ) { - rc = -EIO ; - } - }else if (rc >=0 ) { +if (rc >=0 &&qio_channel_writev_all (s->ioc, qiov->iov, qiov->niov, +NULL ) <0 ) { rc = -EIO ; }qio_channel_set_cork (s->ioc, false);
Signature · 1 line
2.36.1
Quoted 9 lines · Eric Blake
CID 1488362 points out that the second 'rc >= 0' check is now dead code.
Reported-by Peter Maydell <[email protected]>Fixes 172f5f1a40(nbd: remove peppering of nbd_client_connected)Signed-off-by Eric Blake <[email protected]>--- block/nbd.c | 8 ++------
thanks
-- PMM
Quoted 19 lines · Eric Blake
CID 1488362 points out that the second 'rc >= 0' check is now dead code.
Reported-by Peter Maydell <[email protected]>Fixes 172f5f1a40(nbd: remove peppering of nbd_client_connected)Signed-off-by Eric Blake <[email protected]>--- block/nbd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)block/nbd.c +0
-1@@ -521,12 +521,8 @@ static int coroutine_fn nbd_co_send_request(BlockDriverState *bs,if (qiov) {qio_channel_set_cork (s->ioc, true); rc =nbd_send_request (s->ioc, request); -if (rc >=0 ) {
block/nbd.c static int coroutine_fn nbd_co_send_request(BlockDriverState *bs, · line 528
Quoted 10 lines
block/nbd.c +2
-5-if (qio_channel_writev_all (s->ioc, qiov->iov, qiov->niov, -NULL ) <0 ) { - rc = -EIO ; - } - }else if (rc >=0 ) { +if (rc >=0 &&qio_channel_writev_all (s->ioc, qiov->iov, qiov->niov, +NULL ) <0 ) { rc = -EIO ; }qio_channel_set_cork (s->ioc, false);
Hi all! I am back). And happy to start with something simple:
(yes, not @openvz.org, just my personal address. Probably new employer will ask to use a corporate one, if so I'll have to send one another patch to MAINTAINERS. But I'd prefer not to hurry with it.)
Sorry for a long delay. That was a gap between old place of work and a new one. I have planned to do some review and resending work in the list during the gap, but.. There were so many things) Anyway, now at new work I've given some time to continue Qemu maintenance and working on my unfinished series and that's wonderful.
Signature · 2 lines
Best regards, Vladimir
Kevin Wolf
AppliedAm 16.05.2022 um 23:05 hat Eric Blake geschrieben:
Quoted 6 lines
CID 1488362 points out that the second 'rc >= 0' check is now dead code.
Reported-by Peter Maydell <[email protected]>Fixes 172f5f1a40(nbd: remove peppering of nbd_client_connected)Signed-off-by Eric Blake <[email protected]>
Thanks, applied to the block branch.
Kevin