hw: Remove unneeded variable assignment
cover hw: Remove unneeded variable assignment
Fix few warnings reported by Clang static code analyzer.
Philippe Mathieu-Daudé (3):
block/qcow2-bitmap: Remove unneeded variable assignment hw/display/qxl: Remove unneeded variable assignment hw/block/pflash_cfi02: Remove unneeded variable assignment
block/qcow2-bitmap.c | 1 - hw/block/pflash_cfi02.c | 1 - hw/display/qxl.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-)
Signature · 1 line
2.21.1
PATCH 1/3 block/qcow2-bitmap: Remove unneeded variable assignment
Fix warning reported by Clang static code analyzer:
CC block/qcow2-bitmap.o
block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
ret = -EINVAL;
^ ~~~~~~~--- block/qcow2-bitmap.c | 1 - 1 file changed, 1 deletion(-)
block/qcow2-bitmap.c +0 -1
@@ -647,7 +647,6 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,return bm_list; broken_dir: - ret = -EINVAL ;error_setg (errp,"Broken bitmap directory" ); fail:
Signature · 1 line
2.21.1
Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Quoted 4 lines · Philippe Mathieu-Daudé
Fix warning reported by Clang static code analyzer:
CC
block/qcow2-bitmap.o
block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
Quoted 8 lines
ret = -EINVAL; ^ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- block/qcow2-bitmap.c | 1 - 1 file changed, 1 deletion(-)
r~
Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Fix warning reported by Clang static code analyzer:
CC
block/qcow2-bitmap.o
block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
Quoted 9 lines
ret = -EINVAL; ^ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>---
block/qcow2-bitmap.c| 1 -1 file changed, 1 deletion(-)
Unused since its introduction in 88ddffae8fc1e30cc907c2dbb989b7eba9e62319
Jano
Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéQuoted 19 lines · Philippe Mathieu-Daudé
Fix warning reported by Clang static code analyzer:
CC
block/qcow2-bitmap.o
block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never readret = -EINVAL; ^ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- block/qcow2-bitmap.c | 1 - 1 file changed, 1 deletion(-)block/qcow2-bitmap.c +0
-0
block/qcow2-bitmap.c static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset, · line 652
Quoted 7 lines
block/qcow2-bitmap.c +0
-1@@ -647,7 +647,6 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,return bm_list; broken_dir: - ret = -EINVAL ;error_setg (errp,"Broken bitmap directory" ); fail:
Signature · 2 lines
Best regards, Vladimir
Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéAm 15.02.2020 um 17:15 hat Philippe Mathieu-Daudé geschrieben:
Quoted 9 lines
Fix warning reported by Clang static code analyzer:
CC
block/qcow2-bitmap.o
block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never readret = -EINVAL; ^ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>
This isn't hw/, so I'm taking it through my tree. Thanks, applied to the block branch.
Kevin
PATCH 2/3 hw/display/qxl: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéFix warning reported by Clang static code analyzer:
hw/display/qxl.c:1634:14: warning: Value stored to 'orig_io_port' during its initialization is never read
uint32_t orig_io_port = io_port;
^~~~~~~~~~~~ ~~~~~~~--- hw/display/qxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/qxl.c +1 -1
@@ -1631,7 +1631,7 @@ static void ioport_write(void *opaque, hwaddr addr,PCIQXLDevice *d = opaque;uint32_t io_port = addr;qxl_async_io async =QXL_SYNC ; -uint32_t orig_io_port = io_port; +uint32_t orig_io_port;if (d->guest_bug && io_port !=QXL_IO_RESET ) {return ;
Signature · 1 line
2.21.1
Re: [PATCH 2/3] hw/display/qxl: Remove unneeded variable assignment
Quoted 11 lines · Philippe Mathieu-Daudé
Fix warning reported by Clang static code analyzer:
hw/display/qxl.c:1634:14: warning: Value stored to 'orig_io_port' during its initialization is never readuint32_t orig_io_port = io_port; ^~~~~~~~~~~~ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/display/qxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
r~
Laurent Vivier
AppliedRe: [PATCH 2/3] hw/display/qxl: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéLe 15/02/2020 à 17:15, Philippe Mathieu-Daudé a écrit :
Quoted 18 lines
Fix warning reported by Clang static code analyzer:
hw/display/qxl.c:1634:14: warning: Value stored to 'orig_io_port' during its initialization is never readuint32_t orig_io_port = io_port; ^~~~~~~~~~~~ ~~~~~~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/display/qxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/qxl.c +0
-0
hw/display/qxl.c static void ioport_write(void *opaque, hwaddr addr, · line 1637
Quoted 8 lines
hw/display/qxl.c +1
-1@@ -1631,7 +1631,7 @@ static void ioport_write(void *opaque, hwaddr addr,PCIQXLDevice *d = opaque;uint32_t io_port = addr;qxl_async_io async =QXL_SYNC ; -uint32_t orig_io_port = io_port; +uint32_t orig_io_port;if (d->guest_bug && io_port !=QXL_IO_RESET ) {return ;
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH 3/3 hw/block/pflash_cfi02: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéFix warning reported by Clang static code analyzer:
CC hw/block/pflash_cfi02.o
hw/block/pflash_cfi02.c:311:5: warning: Value stored to 'ret' is never read
ret = -1;
^ ~~--- hw/block/pflash_cfi02.c | 1 - 1 file changed, 1 deletion(-)
hw/block/pflash_cfi02.c +0 -1
@@ -308,7 +308,6 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)hwaddr boff;uint64_t ret; - ret =-1 ;/* Lazy reset to ROMD mode after a certain amount of read accesses */ if (!pfl->rom_mode && pfl->wcycle ==0 && ++pfl->read_counter >PFLASH_LAZY_ROMD_THRESHOLD ) {
Signature · 1 line
2.21.1
Re: [PATCH 3/3] hw/block/pflash_cfi02: Remove unneeded variable assignment
Quoted 4 lines · Philippe Mathieu-Daudé
Fix warning reported by Clang static code analyzer:
CC
hw/block/pflash_cfi02.o
hw/block/pflash_cfi02.c:311:5: warning: Value stored to 'ret' is never read
Quoted 8 lines
ret = -1; ^ ~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/block/pflash_cfi02.c | 1 - 1 file changed, 1 deletion(-)
r~
Laurent Vivier
AppliedRe: [PATCH 3/3] hw/block/pflash_cfi02: Remove unneeded variable assignment
In reply to Philippe Mathieu-DaudéLe 15/02/2020 à 17:15, Philippe Mathieu-Daudé a écrit :
Quoted 19 lines
Fix warning reported by Clang static code analyzer:
CC
hw/block/pflash_cfi02.o
hw/block/pflash_cfi02.c:311:5: warning: Value stored to 'ret' is never readret = -1; ^ ~~Reported-by Clang Static AnalyzerSigned-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/block/pflash_cfi02.c | 1 - 1 file changed, 1 deletion(-)hw/block/pflash_cfi02.c +0
-0
hw/block/pflash_cfi02.c static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width) · line 313
Quoted 7 lines
hw/block/pflash_cfi02.c +0
-1@@ -308,7 +308,6 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)hwaddr boff;uint64_t ret; - ret =-1 ;/* Lazy reset to ROMD mode after a certain amount of read accesses */ if (!pfl->rom_mode && pfl->wcycle ==0 && ++pfl->read_counter >PFLASH_LAZY_ROMD_THRESHOLD ) {
Applied to my trivial-patches branch.
Thanks,
Laurent