All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer
@ 2020-03-02 13:07 Chen Qun
  2020-03-02 13:07 ` Chen Qun
                   ` (12 more replies)
  0 siblings, 13 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: peter.maydell, zhang.zhanghailiang, Chen Qun

v1->v2:
- Patch1: Add John Snow review comment.
- Patch9: Move the 'dst_type' declaration to while() statement.
- Patch12: Add Philippe Mathieu-Daudé review comment.
- Patch13: Move the 'set' declaration to the for() statement.

v2->v3:
- Patch1: Add Kevin Wolf review comment.
- Patch2: Keep the 'flags' then use it(Base on Kevin's comments).
- Patch3: Add Kevin Wolf review comment.
- Patch9: Add Francisco Iglesias and Alistair Francis review comment.
- Patch12: Juan Quintela has added it to the queue and delete it.
- Patch12->Patch11: Add Philippe Mathieu-Daudé review comment.
- Patch13->Patch12: Add Philippe Mathieu-Daudé review comment.

Chen Qun (12):
  block/stream: Remove redundant statement in stream_run()
  block/iscsi:Remove redundant statement in iscsi_open()
  block/file-posix: Remove redundant statement in raw_handle_perm_lock()
  scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  scsi/scsi-disk: Remove redundant statement in
    scsi_disk_emulate_command()
  display/pxa2xx_lcd: Remove redundant statement in
    pxa2xx_palette_parse()
  display/exynos4210_fimd: Remove redundant statement in
    exynos4210_fimd_update()
  display/blizzard: Remove redundant statement in
    blizzard_draw_line16_32()
  dma/xlnx-zdma: Remove redundant statement in zdma_write_dst()
  timer/exynos4210_mct: Remove redundant statement in
    exynos4210_mct_write()
  usb/hcd-ehci: Remove redundant statements
  monitor/hmp-cmds: Remove redundant statement in
    hmp_rocker_of_dpa_groups()

 block/file-posix.c           |  1 -
 block/iscsi.c                |  2 +-
 block/stream.c               |  3 +--
 hw/display/blizzard.c        |  1 -
 hw/display/exynos4210_fimd.c |  1 -
 hw/display/pxa2xx_lcd.c      |  1 -
 hw/dma/xlnx-zdma.c           | 10 +++++-----
 hw/scsi/esp-pci.c            |  1 -
 hw/scsi/scsi-disk.c          |  1 -
 hw/timer/exynos4210_mct.c    |  4 ----
 hw/usb/hcd-ehci.c            |  3 ---
 monitor/hmp-cmds.c           |  5 +----
 12 files changed, 8 insertions(+), 25 deletions(-)

-- 
2.23.0




^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-02 13:07 ` [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() Chen Qun
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: peter.maydell, zhang.zhanghailiang, Chen Qun

v1->v2:
- Patch1: Add John Snow review comment.
- Patch9: Move the 'dst_type' declaration to while() statement.
- Patch12: Add Philippe Mathieu-Daudé review comment.
- Patch13: Move the 'set' declaration to the for() statement.

v2->v3:
- Patch1: Add Kevin Wolf review comment.
- Patch2: Keep the 'flags' then use it(Base on Kevin's comments).
- Patch3: Add Kevin Wolf review comment.
- Patch9: Add Francisco Iglesias and Alistair Francis review comment.
- Patch12: Juan Quintela has added it to the queue and delete it.
- Patch12->Patch11: Add Philippe Mathieu-Daudé review comment.
- Patch13->Patch12: Add Philippe Mathieu-Daudé review comment.

Chen Qun (12):
  block/stream: Remove redundant statement in stream_run()
  block/iscsi:Remove redundant statement in iscsi_open()
  block/file-posix: Remove redundant statement in raw_handle_perm_lock()
  scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  scsi/scsi-disk: Remove redundant statement in
    scsi_disk_emulate_command()
  display/pxa2xx_lcd: Remove redundant statement in
    pxa2xx_palette_parse()
  display/exynos4210_fimd: Remove redundant statement in
    exynos4210_fimd_update()
  display/blizzard: Remove redundant statement in
    blizzard_draw_line16_32()
  dma/xlnx-zdma: Remove redundant statement in zdma_write_dst()
  timer/exynos4210_mct: Remove redundant statement in
    exynos4210_mct_write()
  usb/hcd-ehci: Remove redundant statements
  monitor/hmp-cmds: Remove redundant statement in
    hmp_rocker_of_dpa_groups()

 block/file-posix.c           |  1 -
 block/iscsi.c                |  2 +-
 block/stream.c               |  3 +--
 hw/display/blizzard.c        |  1 -
 hw/display/exynos4210_fimd.c |  1 -
 hw/display/pxa2xx_lcd.c      |  1 -
 hw/dma/xlnx-zdma.c           | 10 +++++-----
 hw/scsi/esp-pci.c            |  1 -
 hw/scsi/scsi-disk.c          |  1 -
 hw/timer/exynos4210_mct.c    |  4 ----
 hw/usb/hcd-ehci.c            |  3 ---
 monitor/hmp-cmds.c           |  5 +----
 12 files changed, 8 insertions(+), 25 deletions(-)

-- 
2.23.0




^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
  2020-03-02 13:07 ` Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:13   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open() Chen Qun
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Kevin Wolf, peter.maydell, zhang.zhanghailiang, Max Reitz,
	Euler Robot, Chen Qun, John Snow

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 <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>

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);
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
  2020-03-02 13:07 ` Chen Qun
  2020-03-02 13:07 ` [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-10 14:26   ` Kevin Wolf
  2020-03-02 13:07 ` [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Chen Qun
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Kevin Wolf, peter.maydell, zhang.zhanghailiang, Chen Qun,
	Peter Lieven, Max Reitz, Ronnie Sahlberg, Euler Robot,
	Paolo Bonzini

Clang static code analyzer show warning:
  block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
        flags &= ~BDRV_O_RDWR;
        ^        ~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Lieven <pl@kamp.de>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>

v1->v2:
 Keep the 'flags' then use it(Base on Kevin's comments).
---
 block/iscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 682abd8e09..50bae51700 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
         iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
             iscsilun->block_size;
         if (iscsilun->lbprz) {
-            ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
+            ret = iscsi_allocmap_init(iscsilun, flags);
         }
     }
 
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (2 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:18   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Kevin Wolf, peter.maydell, zhang.zhanghailiang, Max Reitz,
	Euler Robot, Chen Qun

Clang static code analyzer show warning:
  block/file-posix.c:891:9: warning: Value stored to 'op' is never read
        op = RAW_PL_ABORT;
        ^    ~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
---
 block/file-posix.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 6345477112..0f77447a25 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -888,7 +888,6 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
                               "Is another process using the image [%s]?\n",
                               bs->filename);
         }
-        op = RAW_PL_ABORT;
         /* fall through to unlock bytes. */
     case RAW_PL_ABORT:
         raw_apply_lock_bytes(s, s->fd, s->perm, ~s->shared_perm,
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (3 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:21   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, zhang.zhanghailiang, Paolo Bonzini, Chen Qun

Clang static code analyzer show warning:
  hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
        size = 4;
        ^      ~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc:Fam Zheng <fam@euphon.net>
---
 hw/scsi/esp-pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index d5a1f9e017..2e6cc07d4e 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -195,7 +195,6 @@ static void esp_pci_io_write(void *opaque, hwaddr addr,
         val <<= shift;
         val |= current & ~(mask << shift);
         addr &= ~3;
-        size = 4;
     }
 
     if (addr < 0x40) {
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (4 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:30   ` Laurent Vivier
  2020-03-09 12:52   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
                   ` (6 subsequent siblings)
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Fam Zheng, peter.maydell, zhang.zhanghailiang, Chen Qun,
	Euler Robot, Paolo Bonzini

Clang static code analyzer show warning:
scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
    buflen = req->cmd.xfer;
    ^        ~~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Fam Zheng <fam@euphon.net>
---
 hw/scsi/scsi-disk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 10d0794d60..1c0cb63a6f 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -1915,7 +1915,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
         r->iov.iov_base = blk_blockalign(s->qdev.conf.blk, r->buflen);
     }
 
-    buflen = req->cmd.xfer;
     outbuf = r->iov.iov_base;
     memset(outbuf, 0, r->buflen);
     switch (req->cmd.buf[0]) {
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (5 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:32   ` Laurent Vivier
  2020-03-09 12:53   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
                   ` (5 subsequent siblings)
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, zhang.zhanghailiang, Chen Qun

Clang static code analyzer show warning:
hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read
        format = 0;
        ^        ~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
 hw/display/pxa2xx_lcd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index 05f5f84671..464e93161a 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -593,7 +593,6 @@ static void pxa2xx_palette_parse(PXA2xxLCDState *s, int ch, int bpp)
         n = 256;
         break;
     default:
-        format = 0;
         return;
     }
 
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (6 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:35   ` Laurent Vivier
  2020-03-09 12:54   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
                   ` (4 subsequent siblings)
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Igor Mitsyanko, peter.maydell, Euler Robot, zhang.zhanghailiang,
	Chen Qun

Clang static code analyzer show warning:
hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is never read
                is_dirty = false;

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
 hw/display/exynos4210_fimd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index c1071ecd46..05d3265b76 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -1310,7 +1310,6 @@ static void exynos4210_fimd_update(void *opaque)
                 }
                 host_fb_addr += inc_size;
                 fb_line_addr += inc_size;
-                is_dirty = false;
             }
             g_free(snap);
             blend = true;
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (7 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, zhang.zhanghailiang, Chen Qun

Clang static code analyzer show warning:
  hw/display/blizzard.c:940:9: warning: Value stored to 'data' is never read
        data >>= 5;
        ^        ~
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
 hw/display/blizzard.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
index 359e399c2a..62517bdf75 100644
--- a/hw/display/blizzard.c
+++ b/hw/display/blizzard.c
@@ -937,7 +937,6 @@ static void blizzard_draw_line16_32(uint32_t *dest,
         g = (data & 0x3f) << 2;
         data >>= 6;
         r = (data & 0x1f) << 3;
-        data >>= 5;
         *dest++ = rgb_to_pixel32(r, g, b);
     }
 }
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (8 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-02 14:19   ` Edgar E. Iglesias
  2020-03-09 12:38   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 10/12] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
                   ` (2 subsequent siblings)
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Francisco Iglesias,
	Alistair Francis, Edgar E. Iglesias, Alistair Francis,
	Euler Robot, Chen Qun, Philippe Mathieu-Daudé

Clang static code analyzer show warning:
hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never read
            dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
            ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
Cc: Alistair Francis <alistair@alistair23.me>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>

v1->v2: move the 'dst_type' declaration.(Base on Philippe's suggestion).
---
 hw/dma/xlnx-zdma.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
index 8fb83f5b07..eeacad59ce 100644
--- a/hw/dma/xlnx-zdma.c
+++ b/hw/dma/xlnx-zdma.c
@@ -373,7 +373,7 @@ static uint64_t zdma_update_descr_addr(XlnxZDMA *s, bool type,
 static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
 {
     uint32_t dst_size, dlen;
-    bool dst_intr, dst_type;
+    bool dst_intr;
     unsigned int ptype = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, POINT_TYPE);
     unsigned int rw_mode = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, MODE);
     unsigned int burst_type = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_DATA_ATTR,
@@ -387,17 +387,17 @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
     while (len) {
         dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
                               SIZE);
-        dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
-                              TYPE);
         if (dst_size == 0 && ptype == PT_MEM) {
             uint64_t next;
+            bool dst_type = FIELD_EX32(s->dsc_dst.words[3],
+                                       ZDMA_CH_DST_DSCR_WORD3,
+                                       TYPE);
+
             next = zdma_update_descr_addr(s, dst_type,
                                           R_ZDMA_CH_DST_CUR_DSCR_LSB);
             zdma_load_descriptor(s, next, &s->dsc_dst);
             dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
                                   SIZE);
-            dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
-                                  TYPE);
         }
 
         /* Match what hardware does by ignoring the dst_size and only using
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 10/12] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (9 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
  2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
  12 siblings, 0 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Igor Mitsyanko, peter.maydell, Euler Robot, zhang.zhanghailiang,
	Chen Qun

Clang static code analyzer show warning:
hw/timer/exynos4210_mct.c:1370:9: warning: Value stored to 'index' is never read
        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/timer/exynos4210_mct.c:1399:9: warning: Value stored to 'index' is never read
        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/timer/exynos4210_mct.c:1441:9: warning: Value stored to 'index' is never read
        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
---
 hw/timer/exynos4210_mct.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c
index 944120aea5..570cf7075b 100644
--- a/hw/timer/exynos4210_mct.c
+++ b/hw/timer/exynos4210_mct.c
@@ -1367,7 +1367,6 @@ static void exynos4210_mct_write(void *opaque, hwaddr offset,
 
     case L0_TCNTB: case L1_TCNTB:
         lt_i = GET_L_TIMER_IDX(offset);
-        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
 
         /*
          * TCNTB is updated to internal register only after CNT expired.
@@ -1396,7 +1395,6 @@ static void exynos4210_mct_write(void *opaque, hwaddr offset,
 
     case L0_ICNTB: case L1_ICNTB:
         lt_i = GET_L_TIMER_IDX(offset);
-        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
 
         s->l_timer[lt_i].reg.wstat |= L_WSTAT_ICNTB_WRITE;
         s->l_timer[lt_i].reg.cnt[L_REG_CNT_ICNTB] = value &
@@ -1438,8 +1436,6 @@ static void exynos4210_mct_write(void *opaque, hwaddr offset,
 
     case L0_FRCNTB: case L1_FRCNTB:
         lt_i = GET_L_TIMER_IDX(offset);
-        index = GET_L_TIMER_CNT_REG_IDX(offset, lt_i);
-
         DPRINTF("local timer[%d] FRCNTB write %llx\n", lt_i, value);
 
         s->l_timer[lt_i].reg.wstat |= L_WSTAT_FRCCNTB_WRITE;
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (10 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 10/12] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-03 10:28   ` Gerd Hoffmann
  2020-03-09 12:42   ` Laurent Vivier
  2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Gerd Hoffmann, Euler Robot,
	Chen Qun, Philippe Mathieu-Daudé

The "again" assignment is meaningless before g_assert_not_reached.
In addition, the break statements no longer needs to be after
g_assert_not_reached.

Clang static code analyzer show warning:
hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
            again = -1;
            ^       ~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/hcd-ehci.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 56ab2f457f..29d49c2d7e 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
         /* should not be triggerable */
         fprintf(stderr, "USB invalid response %d\n", p->packet.status);
         g_assert_not_reached();
-        break;
     }
 
     /* TODO check 4.12 for splits */
@@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
 
         default:
             fprintf(stderr, "Bad state!\n");
-            again = -1;
             g_assert_not_reached();
-            break;
         }
 
         if (again < 0 || itd_count > 16) {
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups()
  2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
                   ` (11 preceding siblings ...)
  2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
@ 2020-03-02 13:07 ` Chen Qun
  2020-03-09 12:50   ` Laurent Vivier
  2020-03-09 12:58   ` Laurent Vivier
  12 siblings, 2 replies; 36+ messages in thread
From: Chen Qun @ 2020-03-02 13:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Dr. David Alan Gilbert,
	Euler Robot, Chen Qun, Philippe Mathieu-Daudé

Clang static code analyzer show warning:
monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read
                set = true;
                ^     ~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>

v1->v2: move the 'set' declaration to the for() statement(Base on Philippe's suggestion).
---
 monitor/hmp-cmds.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 53bc3f76c4..c6b0495822 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -2808,7 +2808,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
     const char *name = qdict_get_str(qdict, "name");
     uint8_t type = qdict_get_try_int(qdict, "type", 9);
     Error *err = NULL;
-    bool set = false;
 
     list = qmp_query_rocker_of_dpa_groups(name, type != 9, type, &err);
     if (err != NULL) {
@@ -2820,6 +2819,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
 
     for (g = list; g; g = g->next) {
         RockerOfDpaGroup *group = g->value;
+        bool set = false;
 
         monitor_printf(mon, "0x%08x", group->id);
 
@@ -2864,14 +2864,11 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
 
         if (group->has_set_eth_dst) {
             if (!set) {
-                set = true;
                 monitor_printf(mon, " set");
             }
             monitor_printf(mon, " dst %s", group->set_eth_dst);
         }
 
-        set = false;
-
         if (group->has_ttl_check && group->ttl_check) {
             monitor_printf(mon, " check TTL");
         }
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst()
  2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
@ 2020-03-02 14:19   ` Edgar E. Iglesias
  2020-03-09 12:38   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Edgar E. Iglesias @ 2020-03-02 14:19 UTC (permalink / raw)
  To: Chen Qun
  Cc: peter.maydell, zhang.zhanghailiang, QEMU Trivial,
	Francisco Iglesias, Alistair Francis, qemu-devel,
	Alistair Francis, Euler Robot, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 2972 bytes --]

On Mon, 2 Mar. 2020, 07:09 Chen Qun, <kuhn.chenqun@huawei.com> wrote:

> Clang static code analyzer show warning:
> hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never
> read
>             dst_type = FIELD_EX32(s->dsc_dst.words[3],
> ZDMA_CH_DST_DSCR_WORD3,
>


Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>



            ^
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> Cc: Alistair Francis <alistair@alistair23.me>
> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> v1->v2: move the 'dst_type' declaration.(Base on Philippe's suggestion).
> ---
>  hw/dma/xlnx-zdma.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
> index 8fb83f5b07..eeacad59ce 100644
> --- a/hw/dma/xlnx-zdma.c
> +++ b/hw/dma/xlnx-zdma.c
> @@ -373,7 +373,7 @@ static uint64_t zdma_update_descr_addr(XlnxZDMA *s,
> bool type,
>  static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
>  {
>      uint32_t dst_size, dlen;
> -    bool dst_intr, dst_type;
> +    bool dst_intr;
>      unsigned int ptype = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0,
> POINT_TYPE);
>      unsigned int rw_mode = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, MODE);
>      unsigned int burst_type = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_DATA_ATTR,
> @@ -387,17 +387,17 @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t
> *buf, uint32_t len)
>      while (len) {
>          dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
>                                SIZE);
> -        dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
> -                              TYPE);
>          if (dst_size == 0 && ptype == PT_MEM) {
>              uint64_t next;
> +            bool dst_type = FIELD_EX32(s->dsc_dst.words[3],
> +                                       ZDMA_CH_DST_DSCR_WORD3,
> +                                       TYPE);
> +
>              next = zdma_update_descr_addr(s, dst_type,
>                                            R_ZDMA_CH_DST_CUR_DSCR_LSB);
>              zdma_load_descriptor(s, next, &s->dsc_dst);
>              dst_size = FIELD_EX32(s->dsc_dst.words[2],
> ZDMA_CH_DST_DSCR_WORD2,
>                                    SIZE);
> -            dst_type = FIELD_EX32(s->dsc_dst.words[3],
> ZDMA_CH_DST_DSCR_WORD3,
> -                                  TYPE);
>          }
>
>          /* Match what hardware does by ignoring the dst_size and only
> using
> --
> 2.23.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 4940 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
  2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
@ 2020-03-03 10:28   ` Gerd Hoffmann
  2020-03-09 12:42   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Gerd Hoffmann @ 2020-03-03 10:28 UTC (permalink / raw)
  To: Chen Qun
  Cc: peter.maydell, zhang.zhanghailiang, qemu-trivial, qemu-devel,
	Euler Robot, Philippe Mathieu-Daudé

On Mon, Mar 02, 2020 at 09:07:14PM +0800, Chen Qun wrote:
> The "again" assignment is meaningless before g_assert_not_reached.
> In addition, the break statements no longer needs to be after
> g_assert_not_reached.
> 
> Clang static code analyzer show warning:
> hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
>             again = -1;
>             ^       ~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run()
  2020-03-02 13:07 ` [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() Chen Qun
@ 2020-03-09 12:13   ` Laurent Vivier
  0 siblings, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:13 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Kevin Wolf, peter.maydell, zhang.zhanghailiang, Max Reitz,
	Euler Robot, John Snow

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 <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: John Snow <jsnow@redhat.com>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> ---
> Cc: John Snow <jsnow@redhat.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> 
> 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



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock()
  2020-03-02 13:07 ` [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Chen Qun
@ 2020-03-09 12:18   ` Laurent Vivier
  0 siblings, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:18 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Kevin Wolf, peter.maydell, Euler Robot, zhang.zhanghailiang, Max Reitz

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
>   block/file-posix.c:891:9: warning: Value stored to 'op' is never read
>         op = RAW_PL_ABORT;
>         ^    ~~~~~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> ---
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> ---
>  block/file-posix.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/file-posix.c b/block/file-posix.c
> index 6345477112..0f77447a25 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -888,7 +888,6 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
>                                "Is another process using the image [%s]?\n",
>                                bs->filename);
>          }
> -        op = RAW_PL_ABORT;
>          /* fall through to unlock bytes. */
>      case RAW_PL_ABORT:
>          raw_apply_lock_bytes(s, s->fd, s->perm, ~s->shared_perm,
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  2020-03-02 13:07 ` [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
@ 2020-03-09 12:21   ` Laurent Vivier
  2020-03-10 11:52     ` Chenqun (kuhn)
  0 siblings, 1 reply; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:21 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, Paolo Bonzini, zhang.zhanghailiang, Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
>   hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
>         size = 4;
>         ^      ~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc:Fam Zheng <fam@euphon.net>
> ---
>  hw/scsi/esp-pci.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index d5a1f9e017..2e6cc07d4e 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -195,7 +195,6 @@ static void esp_pci_io_write(void *opaque, hwaddr addr,
>          val <<= shift;
>          val |= current & ~(mask << shift);
>          addr &= ~3;
> -        size = 4;
>      }

perhaps a "g_assert(size >= 4)" instead would be cleaner to mute the
warning?

I think it's a good point to update the size if in the future the code
below is modified to use size.

Thanks,
Laurent




^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command()
  2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
@ 2020-03-09 12:30   ` Laurent Vivier
  2020-03-09 12:52   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:30 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Fam Zheng, peter.maydell, Paolo Bonzini, zhang.zhanghailiang,
	Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
>     buflen = req->cmd.xfer;
>     ^        ~~~~~~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Fam Zheng <fam@euphon.net>
> ---
>  hw/scsi/scsi-disk.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 10d0794d60..1c0cb63a6f 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1915,7 +1915,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>          r->iov.iov_base = blk_blockalign(s->qdev.conf.blk, r->buflen);
>      }
>  
> -    buflen = req->cmd.xfer;
>      outbuf = r->iov.iov_base;
>      memset(outbuf, 0, r->buflen);
>      switch (req->cmd.buf[0]) {
> 

Fixes: c8dcb531bcd3 ("scsi: do not return short responses for emulated
commands")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse()
  2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
@ 2020-03-09 12:32   ` Laurent Vivier
  2020-03-09 12:53   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:32 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read
>         format = 0;
>         ^        ~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/pxa2xx_lcd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
> index 05f5f84671..464e93161a 100644
> --- a/hw/display/pxa2xx_lcd.c
> +++ b/hw/display/pxa2xx_lcd.c
> @@ -593,7 +593,6 @@ static void pxa2xx_palette_parse(PXA2xxLCDState *s, int ch, int bpp)
>          n = 256;
>          break;
>      default:
> -        format = 0;
>          return;
>      }
>  
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update()
  2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
@ 2020-03-09 12:35   ` Laurent Vivier
  2020-03-09 12:54   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:35 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Igor Mitsyanko, peter.maydell, zhang.zhanghailiang, Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is never read
>                 is_dirty = false;
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/exynos4210_fimd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
> index c1071ecd46..05d3265b76 100644
> --- a/hw/display/exynos4210_fimd.c
> +++ b/hw/display/exynos4210_fimd.c
> @@ -1310,7 +1310,6 @@ static void exynos4210_fimd_update(void *opaque)
>                  }
>                  host_fb_addr += inc_size;
>                  fb_line_addr += inc_size;
> -                is_dirty = false;
>              }
>              g_free(snap);
>              blend = true;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst()
  2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
  2020-03-02 14:19   ` Edgar E. Iglesias
@ 2020-03-09 12:38   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:38 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Francisco Iglesias,
	Alistair Francis, Alistair Francis, Euler Robot,
	Edgar E. Iglesias, Philippe Mathieu-Daudé

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> hw/dma/xlnx-zdma.c:399:13: warning: Value stored to 'dst_type' is never read
>             dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
>             ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> Cc: Alistair Francis <alistair@alistair23.me>
> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> v1->v2: move the 'dst_type' declaration.(Base on Philippe's suggestion).
> ---
>  hw/dma/xlnx-zdma.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
> index 8fb83f5b07..eeacad59ce 100644
> --- a/hw/dma/xlnx-zdma.c
> +++ b/hw/dma/xlnx-zdma.c
> @@ -373,7 +373,7 @@ static uint64_t zdma_update_descr_addr(XlnxZDMA *s, bool type,
>  static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
>  {
>      uint32_t dst_size, dlen;
> -    bool dst_intr, dst_type;
> +    bool dst_intr;
>      unsigned int ptype = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, POINT_TYPE);
>      unsigned int rw_mode = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, MODE);
>      unsigned int burst_type = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_DATA_ATTR,
> @@ -387,17 +387,17 @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
>      while (len) {
>          dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
>                                SIZE);
> -        dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
> -                              TYPE);
>          if (dst_size == 0 && ptype == PT_MEM) {
>              uint64_t next;
> +            bool dst_type = FIELD_EX32(s->dsc_dst.words[3],
> +                                       ZDMA_CH_DST_DSCR_WORD3,
> +                                       TYPE);
> +
>              next = zdma_update_descr_addr(s, dst_type,
>                                            R_ZDMA_CH_DST_CUR_DSCR_LSB);
>              zdma_load_descriptor(s, next, &s->dsc_dst);
>              dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
>                                    SIZE);
> -            dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3,
> -                                  TYPE);
>          }
>  
>          /* Match what hardware does by ignoring the dst_size and only using
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
  2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
  2020-03-03 10:28   ` Gerd Hoffmann
@ 2020-03-09 12:42   ` Laurent Vivier
  2020-03-09 12:52     ` Chenqun (kuhn)
  1 sibling, 1 reply; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:42 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, Philippe Mathieu-Daudé,
	zhang.zhanghailiang, Gerd Hoffmann

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> The "again" assignment is meaningless before g_assert_not_reached.
> In addition, the break statements no longer needs to be after
> g_assert_not_reached.
> 
> Clang static code analyzer show warning:
> hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
>             again = -1;
>             ^       ~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/usb/hcd-ehci.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
> index 56ab2f457f..29d49c2d7e 100644
> --- a/hw/usb/hcd-ehci.c
> +++ b/hw/usb/hcd-ehci.c
> @@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
>          /* should not be triggerable */
>          fprintf(stderr, "USB invalid response %d\n", p->packet.status);
>          g_assert_not_reached();
> -        break;
>      }
>  
>      /* TODO check 4.12 for splits */
> @@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
>  
>          default:
>              fprintf(stderr, "Bad state!\n");
> -            again = -1;
>              g_assert_not_reached();
> -            break;
>          }
>  
>          if (again < 0 || itd_count > 16) {
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups()
  2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
@ 2020-03-09 12:50   ` Laurent Vivier
  2020-03-09 12:58   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:50 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, Philippe Mathieu-Daudé,
	zhang.zhanghailiang, Dr. David Alan Gilbert

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read
>                 set = true;
>                 ^     ~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> v1->v2: move the 'set' declaration to the for() statement(Base on Philippe's suggestion).
> ---
>  monitor/hmp-cmds.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 53bc3f76c4..c6b0495822 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -2808,7 +2808,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>      const char *name = qdict_get_str(qdict, "name");
>      uint8_t type = qdict_get_try_int(qdict, "type", 9);
>      Error *err = NULL;
> -    bool set = false;
>  
>      list = qmp_query_rocker_of_dpa_groups(name, type != 9, type, &err);
>      if (err != NULL) {
> @@ -2820,6 +2819,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>  
>      for (g = list; g; g = g->next) {
>          RockerOfDpaGroup *group = g->value;
> +        bool set = false;
>  
>          monitor_printf(mon, "0x%08x", group->id);
>  
> @@ -2864,14 +2864,11 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>  
>          if (group->has_set_eth_dst) {
>              if (!set) {
> -                set = true;
>                  monitor_printf(mon, " set");
>              }
>              monitor_printf(mon, " dst %s", group->set_eth_dst);
>          }
>  
> -        set = false;
> -
>          if (group->has_ttl_check && group->ttl_check) {
>              monitor_printf(mon, " check TTL");
>          }
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command()
  2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
  2020-03-09 12:30   ` Laurent Vivier
@ 2020-03-09 12:52   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:52 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Fam Zheng, peter.maydell, Paolo Bonzini, zhang.zhanghailiang,
	Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
>     buflen = req->cmd.xfer;
>     ^        ~~~~~~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Fam Zheng <fam@euphon.net>
> ---
>  hw/scsi/scsi-disk.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 10d0794d60..1c0cb63a6f 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1915,7 +1915,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>          r->iov.iov_base = blk_blockalign(s->qdev.conf.blk, r->buflen);
>      }
>  
> -    buflen = req->cmd.xfer;
>      outbuf = r->iov.iov_base;
>      memset(outbuf, 0, r->buflen);
>      switch (req->cmd.buf[0]) {
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
  2020-03-09 12:42   ` Laurent Vivier
@ 2020-03-09 12:52     ` Chenqun (kuhn)
  2020-03-09 12:55       ` Laurent Vivier
  0 siblings, 1 reply; 36+ messages in thread
From: Chenqun (kuhn) @ 2020-03-09 12:52 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, Philippe Mathieu-Daudé,
	Zhanghailiang, Gerd Hoffmann


>-----Original Message-----
>From: Laurent Vivier [mailto:laurent@vivier.eu]
>Sent: Monday, March 9, 2020 8:43 PM
>To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-
>devel@nongnu.org; qemu-trivial@nongnu.org
>Cc: peter.maydell@linaro.org; Zhanghailiang
><zhang.zhanghailiang@huawei.com>; Gerd Hoffmann <kraxel@redhat.com>;
>Euler Robot <euler.robot@huawei.com>; Philippe Mathieu-Daudé
><philmd@redhat.com>
>Subject: Re: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
>
>Le 02/03/2020 à 14:07, Chen Qun a écrit :
>> The "again" assignment is meaningless before g_assert_not_reached.
>> In addition, the break statements no longer needs to be after
>> g_assert_not_reached.
>>
>> Clang static code analyzer show warning:
>> hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
>>             again = -1;
>>             ^       ~~
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  hw/usb/hcd-ehci.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index
>> 56ab2f457f..29d49c2d7e 100644
>> --- a/hw/usb/hcd-ehci.c
>> +++ b/hw/usb/hcd-ehci.c
>> @@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
>>          /* should not be triggerable */
>>          fprintf(stderr, "USB invalid response %d\n", p->packet.status);
>>          g_assert_not_reached();
>> -        break;
>>      }
>>
>>      /* TODO check 4.12 for splits */
>> @@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci,
>> int async)
>>
>>          default:
>>              fprintf(stderr, "Bad state!\n");
>> -            again = -1;
>>              g_assert_not_reached();
>> -            break;
>>          }
>>
>>          if (again < 0 || itd_count > 16) {
>>
>
>Applied to my trivial-patches branch.
>
Hi, Laurent

Gerd has added a patch to the USB queue today.

https://patchwork.kernel.org/patch/11405615/

>Thanks,
>Laurent


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse()
  2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
  2020-03-09 12:32   ` Laurent Vivier
@ 2020-03-09 12:53   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:53 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, zhang.zhanghailiang, Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> hw/display/pxa2xx_lcd.c:596:9: warning: Value stored to 'format' is never read
>         format = 0;
>         ^        ~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/pxa2xx_lcd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
> index 05f5f84671..464e93161a 100644
> --- a/hw/display/pxa2xx_lcd.c
> +++ b/hw/display/pxa2xx_lcd.c
> @@ -593,7 +593,6 @@ static void pxa2xx_palette_parse(PXA2xxLCDState *s, int ch, int bpp)
>          n = 256;
>          break;
>      default:
> -        format = 0;
>          return;
>      }
>  
> 

Applied to my trivial-patches branch.

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update()
  2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
  2020-03-09 12:35   ` Laurent Vivier
@ 2020-03-09 12:54   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:54 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: Igor Mitsyanko, peter.maydell, zhang.zhanghailiang, Euler Robot

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> hw/display/exynos4210_fimd.c:1313:17: warning: Value stored to 'is_dirty' is never read
>                 is_dirty = false;
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/display/exynos4210_fimd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
> index c1071ecd46..05d3265b76 100644
> --- a/hw/display/exynos4210_fimd.c
> +++ b/hw/display/exynos4210_fimd.c
> @@ -1310,7 +1310,6 @@ static void exynos4210_fimd_update(void *opaque)
>                  }
>                  host_fb_addr += inc_size;
>                  fb_line_addr += inc_size;
> -                is_dirty = false;
>              }
>              g_free(snap);
>              blend = true;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
  2020-03-09 12:52     ` Chenqun (kuhn)
@ 2020-03-09 12:55       ` Laurent Vivier
  0 siblings, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:55 UTC (permalink / raw)
  To: Chenqun (kuhn), qemu-devel, qemu-trivial
  Cc: peter.maydell, Gerd Hoffmann, Philippe Mathieu-Daudé,
	Zhanghailiang, Euler Robot

Le 09/03/2020 à 13:52, Chenqun (kuhn) a écrit :
> 
>> -----Original Message-----
>> From: Laurent Vivier [mailto:laurent@vivier.eu]
>> Sent: Monday, March 9, 2020 8:43 PM
>> To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-
>> devel@nongnu.org; qemu-trivial@nongnu.org
>> Cc: peter.maydell@linaro.org; Zhanghailiang
>> <zhang.zhanghailiang@huawei.com>; Gerd Hoffmann <kraxel@redhat.com>;
>> Euler Robot <euler.robot@huawei.com>; Philippe Mathieu-Daudé
>> <philmd@redhat.com>
>> Subject: Re: [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements
>>
>> Le 02/03/2020 à 14:07, Chen Qun a écrit :
>>> The "again" assignment is meaningless before g_assert_not_reached.
>>> In addition, the break statements no longer needs to be after
>>> g_assert_not_reached.
>>>
>>> Clang static code analyzer show warning:
>>> hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
>>>             again = -1;
>>>             ^       ~~
>>>
>>> Reported-by: Euler Robot <euler.robot@huawei.com>
>>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>>  hw/usb/hcd-ehci.c | 3 ---
>>>  1 file changed, 3 deletions(-)
>>>
>>> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index
>>> 56ab2f457f..29d49c2d7e 100644
>>> --- a/hw/usb/hcd-ehci.c
>>> +++ b/hw/usb/hcd-ehci.c
>>> @@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
>>>          /* should not be triggerable */
>>>          fprintf(stderr, "USB invalid response %d\n", p->packet.status);
>>>          g_assert_not_reached();
>>> -        break;
>>>      }
>>>
>>>      /* TODO check 4.12 for splits */
>>> @@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci,
>>> int async)
>>>
>>>          default:
>>>              fprintf(stderr, "Bad state!\n");
>>> -            again = -1;
>>>              g_assert_not_reached();
>>> -            break;
>>>          }
>>>
>>>          if (again < 0 || itd_count > 16) {
>>>
>>
>> Applied to my trivial-patches branch.
>>
> Hi, Laurent
> 
> Gerd has added a patch to the USB queue today.
> 
> https://patchwork.kernel.org/patch/11405615/
>

Ok, removing it from mine.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups()
  2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
  2020-03-09 12:50   ` Laurent Vivier
@ 2020-03-09 12:58   ` Laurent Vivier
  1 sibling, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-09 12:58 UTC (permalink / raw)
  To: Chen Qun, qemu-devel, qemu-trivial
  Cc: peter.maydell, Euler Robot, Philippe Mathieu-Daudé,
	zhang.zhanghailiang, Dr. David Alan Gilbert

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> monitor/hmp-cmds.c:2867:17: warning: Value stored to 'set' is never read
>                 set = true;
>                 ^     ~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> v1->v2: move the 'set' declaration to the for() statement(Base on Philippe's suggestion).
> ---
>  monitor/hmp-cmds.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 53bc3f76c4..c6b0495822 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -2808,7 +2808,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>      const char *name = qdict_get_str(qdict, "name");
>      uint8_t type = qdict_get_try_int(qdict, "type", 9);
>      Error *err = NULL;
> -    bool set = false;
>  
>      list = qmp_query_rocker_of_dpa_groups(name, type != 9, type, &err);
>      if (err != NULL) {
> @@ -2820,6 +2819,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>  
>      for (g = list; g; g = g->next) {
>          RockerOfDpaGroup *group = g->value;
> +        bool set = false;
>  
>          monitor_printf(mon, "0x%08x", group->id);
>  
> @@ -2864,14 +2864,11 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
>  
>          if (group->has_set_eth_dst) {
>              if (!set) {
> -                set = true;
>                  monitor_printf(mon, " set");
>              }
>              monitor_printf(mon, " dst %s", group->set_eth_dst);
>          }
>  
> -        set = false;
> -
>          if (group->has_ttl_check && group->ttl_check) {
>              monitor_printf(mon, " check TTL");
>          }
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  2020-03-09 12:21   ` Laurent Vivier
@ 2020-03-10 11:52     ` Chenqun (kuhn)
  2020-03-10 13:00       ` Laurent Vivier
  0 siblings, 1 reply; 36+ messages in thread
From: Chenqun (kuhn) @ 2020-03-10 11:52 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel, qemu-trivial
  Cc: peter.maydell, Paolo Bonzini, Zhanghailiang, Euler Robot

>-----Original Message-----
>From: Laurent Vivier [mailto:laurent@vivier.eu]
>Sent: Monday, March 9, 2020 8:22 PM
>To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-
>devel@nongnu.org; qemu-trivial@nongnu.org
>Cc: peter.maydell@linaro.org; Euler Robot <euler.robot@huawei.com>;
>Zhanghailiang <zhang.zhanghailiang@huawei.com>; Paolo Bonzini
><pbonzini@redhat.com>
>Subject: Re: [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in
>esp_pci_io_write()
>
>Le 02/03/2020 à 14:07, Chen Qun a écrit :
>> Clang static code analyzer show warning:
>>   hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
>>         size = 4;
>>         ^      ~
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>> ---
>> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc:Fam Zheng
><fam@euphon.net>
>> ---
>>  hw/scsi/esp-pci.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index
>> d5a1f9e017..2e6cc07d4e 100644
>> --- a/hw/scsi/esp-pci.c
>> +++ b/hw/scsi/esp-pci.c
>> @@ -195,7 +195,6 @@ static void esp_pci_io_write(void *opaque, hwaddr
>addr,
>>          val <<= shift;
>>          val |= current & ~(mask << shift);
>>          addr &= ~3;
>> -        size = 4;
>>      }
>
>perhaps a "g_assert(size >= 4)" instead would be cleaner to mute the warning?
>
Yes, add 'g_assert(size >= 4)' can mute the warning.

>
>I think it's a good point to update the size if in the future the code below is
>modified to use size.
>
Hmm, maybe it is true.

So, let's  keep ' size = 4'  and  add 'g_assert(size >= 4)' after if() statement , shall we?

Thanks,
Chen Qun
>
>Thanks,
>Laurent
>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
  2020-03-10 11:52     ` Chenqun (kuhn)
@ 2020-03-10 13:00       ` Laurent Vivier
  0 siblings, 0 replies; 36+ messages in thread
From: Laurent Vivier @ 2020-03-10 13:00 UTC (permalink / raw)
  To: Chenqun (kuhn), qemu-devel, qemu-trivial, Paolo Bonzini, Fam Zheng
  Cc: peter.maydell, Zhanghailiang, Euler Robot

Le 10/03/2020 à 12:52, Chenqun (kuhn) a écrit :
>> -----Original Message-----
>> From: Laurent Vivier [mailto:laurent@vivier.eu]
>> Sent: Monday, March 9, 2020 8:22 PM
>> To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-
>> devel@nongnu.org; qemu-trivial@nongnu.org
>> Cc: peter.maydell@linaro.org; Euler Robot <euler.robot@huawei.com>;
>> Zhanghailiang <zhang.zhanghailiang@huawei.com>; Paolo Bonzini
>> <pbonzini@redhat.com>
>> Subject: Re: [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in
>> esp_pci_io_write()
>>
>> Le 02/03/2020 à 14:07, Chen Qun a écrit :
>>> Clang static code analyzer show warning:
>>>   hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
>>>         size = 4;
>>>         ^      ~
>>>
>>> Reported-by: Euler Robot <euler.robot@huawei.com>
>>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>>> ---
>>> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc:Fam Zheng
>> <fam@euphon.net>
>>> ---
>>>  hw/scsi/esp-pci.c | 1 -
>>>  1 file changed, 1 deletion(-)
>>>
>>> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index
>>> d5a1f9e017..2e6cc07d4e 100644
>>> --- a/hw/scsi/esp-pci.c
>>> +++ b/hw/scsi/esp-pci.c
>>> @@ -195,7 +195,6 @@ static void esp_pci_io_write(void *opaque, hwaddr
>> addr,
>>>          val <<= shift;
>>>          val |= current & ~(mask << shift);
>>>          addr &= ~3;
>>> -        size = 4;
>>>      }
>>
>> perhaps a "g_assert(size >= 4)" instead would be cleaner to mute the warning?
>>
> Yes, add 'g_assert(size >= 4)' can mute the warning.
> 
>>
>> I think it's a good point to update the size if in the future the code below is
>> modified to use size.
>>
> Hmm, maybe it is true.
> 
> So, let's  keep ' size = 4'  and  add 'g_assert(size >= 4)' after if() statement , shall we?

Yes, it's what I would prefer. But it's a question of taste...

Paolo? Fam?

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open()
  2020-03-02 13:07 ` [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open() Chen Qun
@ 2020-03-10 14:26   ` Kevin Wolf
  2020-03-10 15:02     ` Laurent Vivier
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Wolf @ 2020-03-10 14:26 UTC (permalink / raw)
  To: Chen Qun
  Cc: peter.maydell, zhang.zhanghailiang, qemu-trivial, Peter Lieven,
	qemu-devel, Max Reitz, Ronnie Sahlberg, Euler Robot,
	Paolo Bonzini

Am 02.03.2020 um 14:07 hat Chen Qun geschrieben:
> Clang static code analyzer show warning:
>   block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
>         flags &= ~BDRV_O_RDWR;
>         ^        ~~~~~~~~~~~~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Lieven <pl@kamp.de>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> 
> v1->v2:
>  Keep the 'flags' then use it(Base on Kevin's comments).

I think this patch wants a different subject line now.

> diff --git a/block/iscsi.c b/block/iscsi.c
> index 682abd8e09..50bae51700 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
>          iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
>              iscsilun->block_size;
>          if (iscsilun->lbprz) {
> -            ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
> +            ret = iscsi_allocmap_init(iscsilun, flags);
>          }
>      }

The code looks good.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open()
  2020-03-10 14:26   ` Kevin Wolf
@ 2020-03-10 15:02     ` Laurent Vivier
  2020-03-11  2:04       ` Chenqun (kuhn)
  0 siblings, 1 reply; 36+ messages in thread
From: Laurent Vivier @ 2020-03-10 15:02 UTC (permalink / raw)
  To: Kevin Wolf, Chen Qun
  Cc: peter.maydell, zhang.zhanghailiang, qemu-trivial, Peter Lieven,
	qemu-devel, Max Reitz, Ronnie Sahlberg, Euler Robot,
	Paolo Bonzini

Le 10/03/2020 à 15:26, Kevin Wolf a écrit :
> Am 02.03.2020 um 14:07 hat Chen Qun geschrieben:
>> Clang static code analyzer show warning:
>>   block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
>>         flags &= ~BDRV_O_RDWR;
>>         ^        ~~~~~~~~~~~~
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>> ---
>> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: Peter Lieven <pl@kamp.de>
>> Cc: Kevin Wolf <kwolf@redhat.com>
>> Cc: Max Reitz <mreitz@redhat.com>
>>
>> v1->v2:
>>  Keep the 'flags' then use it(Base on Kevin's comments).
> 
> I think this patch wants a different subject line now.


It needs also a better explanation in the commit message and should not
go through trivial as the change is not obvious.

Thanks,
Laurent

> 
>> diff --git a/block/iscsi.c b/block/iscsi.c
>> index 682abd8e09..50bae51700 100644
>> --- a/block/iscsi.c
>> +++ b/block/iscsi.c
>> @@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
>>          iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
>>              iscsilun->block_size;
>>          if (iscsilun->lbprz) {
>> -            ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
>> +            ret = iscsi_allocmap_init(iscsilun, flags);
>>          }
>>      }
> 
> The code looks good.
> 
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> 
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open()
  2020-03-10 15:02     ` Laurent Vivier
@ 2020-03-11  2:04       ` Chenqun (kuhn)
  0 siblings, 0 replies; 36+ messages in thread
From: Chenqun (kuhn) @ 2020-03-11  2:04 UTC (permalink / raw)
  To: Laurent Vivier, Kevin Wolf
  Cc: peter.maydell, Zhanghailiang, qemu-trivial, Peter Lieven,
	qemu-devel, Max Reitz, Ronnie Sahlberg, Euler Robot,
	Paolo Bonzini

>-----Original Message-----
>From: Laurent Vivier [mailto:laurent@vivier.eu]
>Sent: Tuesday, March 10, 2020 11:02 PM
>To: Kevin Wolf <kwolf@redhat.com>; Chenqun (kuhn)
><kuhn.chenqun@huawei.com>
>Cc: peter.maydell@linaro.org; Zhanghailiang
><zhang.zhanghailiang@huawei.com>; qemu-trivial@nongnu.org; Peter Lieven
><pl@kamp.de>; qemu-devel@nongnu.org; Max Reitz <mreitz@redhat.com>;
>Ronnie Sahlberg <ronniesahlberg@gmail.com>; Euler Robot
><euler.robot@huawei.com>; Paolo Bonzini <pbonzini@redhat.com>
>Subject: Re: [PATCH v3 02/12] block/iscsi:Remove redundant statement in
>iscsi_open()
>
>Le 10/03/2020 à 15:26, Kevin Wolf a écrit :
>> Am 02.03.2020 um 14:07 hat Chen Qun geschrieben:
>>> Clang static code analyzer show warning:
>>>   block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
>>>         flags &= ~BDRV_O_RDWR;
>>>         ^        ~~~~~~~~~~~~
>>>
>>> Reported-by: Euler Robot <euler.robot@huawei.com>
>>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>>> ---
>>> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
>>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>>> Cc: Peter Lieven <pl@kamp.de>
>>> Cc: Kevin Wolf <kwolf@redhat.com>
>>> Cc: Max Reitz <mreitz@redhat.com>
>>>
>>> v1->v2:
>>>  Keep the 'flags' then use it(Base on Kevin's comments).
>>
>> I think this patch wants a different subject line now.
>
Yes,  it needs a more appropriate subject.

>It needs also a better explanation in the commit message and should not go
>through trivial as the change is not obvious.
>
OK , I will update the commit message base on existing comments.

Thanks.

>Thanks,
>Laurent
>
>>
>>> diff --git a/block/iscsi.c b/block/iscsi.c index
>>> 682abd8e09..50bae51700 100644
>>> --- a/block/iscsi.c
>>> +++ b/block/iscsi.c
>>> @@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict
>*options, int flags,
>>>          iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
>>>              iscsilun->block_size;
>>>          if (iscsilun->lbprz) {
>>> -            ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
>>> +            ret = iscsi_allocmap_init(iscsilun, flags);
>>>          }
>>>      }
>>
>> The code looks good.
>>
>> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
>>
>>


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2020-03-11  2:05 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
2020-03-02 13:07 ` Chen Qun
2020-03-02 13:07 ` [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() Chen Qun
2020-03-09 12:13   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open() Chen Qun
2020-03-10 14:26   ` Kevin Wolf
2020-03-10 15:02     ` Laurent Vivier
2020-03-11  2:04       ` Chenqun (kuhn)
2020-03-02 13:07 ` [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Chen Qun
2020-03-09 12:18   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
2020-03-09 12:21   ` Laurent Vivier
2020-03-10 11:52     ` Chenqun (kuhn)
2020-03-10 13:00       ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
2020-03-09 12:30   ` Laurent Vivier
2020-03-09 12:52   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
2020-03-09 12:32   ` Laurent Vivier
2020-03-09 12:53   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
2020-03-09 12:35   ` Laurent Vivier
2020-03-09 12:54   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
2020-03-02 14:19   ` Edgar E. Iglesias
2020-03-09 12:38   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 10/12] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
2020-03-03 10:28   ` Gerd Hoffmann
2020-03-09 12:42   ` Laurent Vivier
2020-03-09 12:52     ` Chenqun (kuhn)
2020-03-09 12:55       ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
2020-03-09 12:50   ` Laurent Vivier
2020-03-09 12:58   ` Laurent Vivier

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.