]> Git Repo - qemu.git/commitdiff
block/stream: Remove redundant statement in stream_run()
authorChen Qun <[email protected]>
Mon, 2 Mar 2020 13:07:04 +0000 (21:07 +0800)
committerLaurent Vivier <[email protected]>
Mon, 9 Mar 2020 14:59:31 +0000 (15:59 +0100)
Clang static code analyzer show warning:
  block/stream.c:186:9: warning: Value stored to 'ret' is never read
        ret = 0;
        ^     ~
Reported-by: Euler Robot <[email protected]>
Signed-off-by: Chen Qun <[email protected]>
Reviewed-by: John Snow <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-Id: <20200302130715[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
block/stream.c

index 5562ccbf577a20ddd520ec080c2608763109f997..aa2e7af98e37747526efbba6ef1120294e6abc55 100644 (file)
@@ -114,7 +114,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
     int64_t offset = 0;
     uint64_t delay_ns = 0;
     int error = 0;
-    int ret = 0;
     int64_t n = 0; /* bytes */
 
     if (bs == s->bottom) {
@@ -139,6 +138,7 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
 
     for ( ; offset < len; offset += n) {
         bool copy;
+        int ret;
 
         /* Note that even when no rate limit is applied we need to yield
          * with no pending I/O here so that bdrv_drain_all() returns.
@@ -183,7 +183,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
                 break;
             }
         }
-        ret = 0;
 
         /* Publish progress */
         job_progress_update(&s->common.job, n);
This page took 0.026939 seconds and 4 git commands to generate.