* [PATCH 0/3] hw: Remove unneeded variable assignment
@ 2020-02-15 16:15 Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-15 16:15 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Philippe Mathieu-Daudé,
Max Reitz, Gerd Hoffmann, John Snow
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(-)
--
2.21.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
2020-02-15 16:15 [PATCH 0/3] hw: Remove unneeded variable assignment Philippe Mathieu-Daudé
@ 2020-02-15 16:15 ` Philippe Mathieu-Daudé
2020-02-16 2:11 ` Richard Henderson
` (3 more replies)
2020-02-15 16:15 ` [PATCH 2/3] hw/display/qxl: " Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 3/3] hw/block/pflash_cfi02: " Philippe Mathieu-Daudé
2 siblings, 4 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-15 16:15 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Philippe Mathieu-Daudé,
Max Reitz, Gerd Hoffmann, John Snow
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;
^ ~~~~~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
block/qcow2-bitmap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index d41f5d049b..8cccc2c9f3 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -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:
--
2.21.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/3] hw/display/qxl: Remove unneeded variable assignment
2020-02-15 16:15 [PATCH 0/3] hw: Remove unneeded variable assignment Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
@ 2020-02-15 16:15 ` Philippe Mathieu-Daudé
2020-02-16 2:13 ` Richard Henderson
2020-02-18 19:15 ` Laurent Vivier
2020-02-15 16:15 ` [PATCH 3/3] hw/block/pflash_cfi02: " Philippe Mathieu-Daudé
2 siblings, 2 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-15 16:15 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Philippe Mathieu-Daudé,
Max Reitz, Gerd Hoffmann, John Snow
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;
^~~~~~~~~~~~ ~~~~~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/display/qxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 64884da708..21a43a1d5e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -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;
--
2.21.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] hw/block/pflash_cfi02: Remove unneeded variable assignment
2020-02-15 16:15 [PATCH 0/3] hw: Remove unneeded variable assignment Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 2/3] hw/display/qxl: " Philippe Mathieu-Daudé
@ 2020-02-15 16:15 ` Philippe Mathieu-Daudé
2020-02-16 2:14 ` Richard Henderson
2020-02-18 19:16 ` Laurent Vivier
2 siblings, 2 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-15 16:15 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Philippe Mathieu-Daudé,
Max Reitz, Gerd Hoffmann, John Snow
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;
^ ~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/block/pflash_cfi02.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 7c4744c020..12f18d401a 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -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) {
--
2.21.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
@ 2020-02-16 2:11 ` Richard Henderson
2020-02-16 21:12 ` Ján Tomko
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2020-02-16 2:11 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Max Reitz, Gerd Hoffmann, John Snow
On 2/15/20 8:15 AM, Philippe Mathieu-Daudé wrote:
> 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;
> ^ ~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> block/qcow2-bitmap.c | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] hw/display/qxl: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 2/3] hw/display/qxl: " Philippe Mathieu-Daudé
@ 2020-02-16 2:13 ` Richard Henderson
2020-02-18 19:15 ` Laurent Vivier
1 sibling, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2020-02-16 2:13 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Max Reitz, Gerd Hoffmann, John Snow
On 2/15/20 8:15 AM, Philippe Mathieu-Daudé wrote:
> 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;
> ^~~~~~~~~~~~ ~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/display/qxl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] hw/block/pflash_cfi02: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 3/3] hw/block/pflash_cfi02: " Philippe Mathieu-Daudé
@ 2020-02-16 2:14 ` Richard Henderson
2020-02-18 19:16 ` Laurent Vivier
1 sibling, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2020-02-16 2:14 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Max Reitz, Gerd Hoffmann, John Snow
On 2/15/20 8:15 AM, Philippe Mathieu-Daudé wrote:
> 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;
> ^ ~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/block/pflash_cfi02.c | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
2020-02-16 2:11 ` Richard Henderson
@ 2020-02-16 21:12 ` Ján Tomko
2020-02-17 8:24 ` Vladimir Sementsov-Ogievskiy
2020-02-17 11:02 ` Kevin Wolf
3 siblings, 0 replies; 12+ messages in thread
From: Ján Tomko @ 2020-02-16 21:12 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, qemu-devel, Max Reitz, Gerd Hoffmann, John Snow
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
On Sat, Feb 15, 2020 at 05:15:55PM +0100, Philippe Mathieu-Daudé wrote:
>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;
> ^ ~~~~~~~
>
>Reported-by: Clang Static Analyzer
>Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>---
> block/qcow2-bitmap.c | 1 -
> 1 file changed, 1 deletion(-)
>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Unused since its introduction in 88ddffae8fc1e30cc907c2dbb989b7eba9e62319
Jano
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
2020-02-16 2:11 ` Richard Henderson
2020-02-16 21:12 ` Ján Tomko
@ 2020-02-17 8:24 ` Vladimir Sementsov-Ogievskiy
2020-02-17 11:02 ` Kevin Wolf
3 siblings, 0 replies; 12+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-02-17 8:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, qemu-block, qemu-trivial, Max Reitz, Gerd Hoffmann,
John Snow
15.02.2020 19:15, Philippe Mathieu-Daudé wrote:
> 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;
> ^ ~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> block/qcow2-bitmap.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index d41f5d049b..8cccc2c9f3 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -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:
>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
--
Best regards,
Vladimir
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2020-02-17 8:24 ` Vladimir Sementsov-Ogievskiy
@ 2020-02-17 11:02 ` Kevin Wolf
3 siblings, 0 replies; 12+ messages in thread
From: Kevin Wolf @ 2020-02-17 11:02 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Vladimir Sementsov-Ogievskiy, qemu-block, qemu-trivial,
qemu-devel, Max Reitz, Gerd Hoffmann, John Snow
Am 15.02.2020 um 17:15 hat Philippe Mathieu-Daudé geschrieben:
> 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;
> ^ ~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This isn't hw/, so I'm taking it through my tree. Thanks, applied to the
block branch.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] hw/display/qxl: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 2/3] hw/display/qxl: " Philippe Mathieu-Daudé
2020-02-16 2:13 ` Richard Henderson
@ 2020-02-18 19:15 ` Laurent Vivier
1 sibling, 0 replies; 12+ messages in thread
From: Laurent Vivier @ 2020-02-18 19:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Max Reitz, Gerd Hoffmann, John Snow
Le 15/02/2020 à 17:15, Philippe Mathieu-Daudé a écrit :
> 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;
> ^~~~~~~~~~~~ ~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/display/qxl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 64884da708..21a43a1d5e 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] hw/block/pflash_cfi02: Remove unneeded variable assignment
2020-02-15 16:15 ` [PATCH 3/3] hw/block/pflash_cfi02: " Philippe Mathieu-Daudé
2020-02-16 2:14 ` Richard Henderson
@ 2020-02-18 19:16 ` Laurent Vivier
1 sibling, 0 replies; 12+ messages in thread
From: Laurent Vivier @ 2020-02-18 19:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-block,
qemu-trivial, Max Reitz, Gerd Hoffmann, John Snow
Le 15/02/2020 à 17:15, Philippe Mathieu-Daudé a écrit :
> 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;
> ^ ~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/block/pflash_cfi02.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
> index 7c4744c020..12f18d401a 100644
> --- a/hw/block/pflash_cfi02.c
> +++ b/hw/block/pflash_cfi02.c
> @@ -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
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-02-18 19:24 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15 16:15 [PATCH 0/3] hw: Remove unneeded variable assignment Philippe Mathieu-Daudé
2020-02-15 16:15 ` [PATCH 1/3] block/qcow2-bitmap: " Philippe Mathieu-Daudé
2020-02-16 2:11 ` Richard Henderson
2020-02-16 21:12 ` Ján Tomko
2020-02-17 8:24 ` Vladimir Sementsov-Ogievskiy
2020-02-17 11:02 ` Kevin Wolf
2020-02-15 16:15 ` [PATCH 2/3] hw/display/qxl: " Philippe Mathieu-Daudé
2020-02-16 2:13 ` Richard Henderson
2020-02-18 19:15 ` Laurent Vivier
2020-02-15 16:15 ` [PATCH 3/3] hw/block/pflash_cfi02: " Philippe Mathieu-Daudé
2020-02-16 2:14 ` Richard Henderson
2020-02-18 19:16 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).