block/qcow2-cluster: remove dead code
PATCH 1/1 block/qcow2-cluster: remove dead code
Since handle_dependencies() returns 0 or -EAGAIN the following case can be removed. Spotted by PVS-Studio.
Signed-off-by Elena Afanasova <[email protected]>
--- block/qcow2-cluster.c | 2 -- 1 file changed, 2 deletions(-)
block/qcow2-cluster.c +0 -2
@@ -1806,8 +1806,6 @@ again:* structs before starting over. */ assert (*m ==NULL ); goto again; - }else if (ret <0 ) { -return ret; }else if (cur_bytes ==0 ) {break ; }else {
Signature · 1 line
2.25.1
Am 15.10.2020 um 14:13 hat Elena Afanasova geschrieben:
Quoted 13 lines
Since
handle_dependencies()returns 0 or-EAGAINthe following case can be removed. Spotted by PVS-Studio.Signed-off-by Elena Afanasova <[email protected]>--- block/qcow2-cluster.c | 2 -- 1 file changed, 2 deletions(-)block/qcow2-cluster.c +0
-0
block/qcow2-cluster.c again: · line 1811
Quoted 8 lines
block/qcow2-cluster.c +0
-2@@ -1806,8 +1806,6 @@ again:* structs before starting over. */ assert (*m ==NULL ); goto again; - }else if (ret <0 ) { -return ret; }else if (cur_bytes ==0 ) {break ; }else {
Technically correct, but let's keep it for anyone who will return a different error code in the future. I think we should always check for any error even if it is currently not produced.
Kevin