[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/12] block/stream: Remove redundant statement in stream_
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() |
Date: |
Mon, 9 Mar 2020 13:13:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
Le 02/03/2020 à 14:07, Chen Qun a écrit :
> 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 <address@hidden>
> Signed-off-by: Chen Qun <address@hidden>
> Reviewed-by: John Snow <address@hidden>
> Reviewed-by: Kevin Wolf <address@hidden>
> ---
> Cc: John Snow <address@hidden>
> Cc: Kevin Wolf <address@hidden>
> Cc: Max Reitz <address@hidden>
>
> v1->v2:move 'ret' declaration to the for() statement(Base on Kevin's
> comments).
> ---
> block/stream.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/block/stream.c b/block/stream.c
> index 5562ccbf57..aa2e7af98e 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -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);
>
Applied to my trivial-patches branch.
Thanks,
Laurent
- [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write(), (continued)
- [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32(), Chen Qun, 2020/03/02
- [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer, Chen Qun, 2020/03/02
- [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse(), Chen Qun, 2020/03/02
- [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run(), Chen Qun, 2020/03/02
- Re: [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run(),
Laurent Vivier <=
- [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open(), Chen Qun, 2020/03/02
[PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update(), Chen Qun, 2020/03/02
[PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements, Chen Qun, 2020/03/02