[PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes

Philippe Mathieu-Daudé posted 11 patches 4 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200321144110.5010-1-philmd@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Joel Stanley <joel@jms.id.au>, Andrzej Zaborowski <balrogg@gmail.com>, BALATON Zoltan <balaton@eik.bme.hu>, Markus Armbruster <armbru@redhat.com>, Fam Zheng <fam@euphon.net>, David Gibson <david@gibson.dropbear.id.au>, Alistair Francis <alistair@alistair23.me>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Max Reitz <mreitz@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Andrew Jeffery <andrew@aj.id.au>, "Cédric Le Goater" <clg@kaod.org>, Kevin Wolf <kwolf@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
There is a newer version of this series
block.c                    | 2 +-
blockdev.c                 | 2 +-
hw/gpio/aspeed_gpio.c      | 2 +-
hw/i2c/pm_smbus.c          | 1 -
hw/ide/sii3112.c           | 5 +++--
hw/input/adb-kbd.c         | 6 +-----
hw/isa/i82378.c            | 8 ++++----
hw/scsi/esp-pci.c          | 1 -
hw/timer/exynos4210_mct.c  | 3 ---
hw/timer/pxa2xx_timer.c    | 1 +
hw/timer/stm32f2xx_timer.c | 1 -
11 files changed, 12 insertions(+), 20 deletions(-)
[PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
Fix trivial warnings reported by the Clang static code analyzer.

Since v1:
- Addressed Markus/Zoltan/Aleksandar review comments

Philippe Mathieu-Daudé (11):
  block: Avoid dead assignment
  blockdev: Remove dead assignment
  hw/i2c/pm_smbus: Remove dead assignment
  hw/input/adb-kbd: Remove dead assignment
  hw/ide/sii3112: Remove dead assignment
  hw/isa/i82378: Remove dead assignment
  hw/gpio/aspeed_gpio: Remove dead assignment
  hw/timer/exynos4210_mct: Remove dead assignments
  hw/timer/stm32f2xx_timer: Remove dead assignment
  hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning
  hw/scsi/esp-pci: Remove dead assignment

 block.c                    | 2 +-
 blockdev.c                 | 2 +-
 hw/gpio/aspeed_gpio.c      | 2 +-
 hw/i2c/pm_smbus.c          | 1 -
 hw/ide/sii3112.c           | 5 +++--
 hw/input/adb-kbd.c         | 6 +-----
 hw/isa/i82378.c            | 8 ++++----
 hw/scsi/esp-pci.c          | 1 -
 hw/timer/exynos4210_mct.c  | 3 ---
 hw/timer/pxa2xx_timer.c    | 1 +
 hw/timer/stm32f2xx_timer.c | 1 -
 11 files changed, 12 insertions(+), 20 deletions(-)

-- 
2.21.1


Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Laurent Vivier 4 years ago
Le 21/03/2020 à 15:40, Philippe Mathieu-Daudé a écrit :
> Fix trivial warnings reported by the Clang static code analyzer.
> 
> Since v1:
> - Addressed Markus/Zoltan/Aleksandar review comments
> 
> Philippe Mathieu-Daudé (11):
>   block: Avoid dead assignment
>   blockdev: Remove dead assignment
>   hw/i2c/pm_smbus: Remove dead assignment
>   hw/input/adb-kbd: Remove dead assignment
>   hw/ide/sii3112: Remove dead assignment
>   hw/isa/i82378: Remove dead assignment
>   hw/gpio/aspeed_gpio: Remove dead assignment
>   hw/timer/exynos4210_mct: Remove dead assignments
>   hw/timer/stm32f2xx_timer: Remove dead assignment
>   hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning
>   hw/scsi/esp-pci: Remove dead assignment
> 
>  block.c                    | 2 +-
>  blockdev.c                 | 2 +-
>  hw/gpio/aspeed_gpio.c      | 2 +-
>  hw/i2c/pm_smbus.c          | 1 -
>  hw/ide/sii3112.c           | 5 +++--
>  hw/input/adb-kbd.c         | 6 +-----
>  hw/isa/i82378.c            | 8 ++++----
>  hw/scsi/esp-pci.c          | 1 -
>  hw/timer/exynos4210_mct.c  | 3 ---
>  hw/timer/pxa2xx_timer.c    | 1 +
>  hw/timer/stm32f2xx_timer.c | 1 -
>  11 files changed, 12 insertions(+), 20 deletions(-)
> 

I think your series covers cases already covered by:

[PATCH v3 00/12] redundant code: Fix warnings reported by Clang static
code analyzer
https://patchew.org/QEMU/20200302130715.29440-1-kuhn.ch

Thanks,
Laurent

Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Philippe Mathieu-Daudé 4 years ago
On 3/23/20 3:32 PM, Laurent Vivier wrote:
> Le 21/03/2020 à 15:40, Philippe Mathieu-Daudé a écrit :
>> Fix trivial warnings reported by the Clang static code analyzer.
>>
>> Since v1:
>> - Addressed Markus/Zoltan/Aleksandar review comments
>>
>> Philippe Mathieu-Daudé (11):
>>    block: Avoid dead assignment
>>    blockdev: Remove dead assignment
>>    hw/i2c/pm_smbus: Remove dead assignment
>>    hw/input/adb-kbd: Remove dead assignment
>>    hw/ide/sii3112: Remove dead assignment
>>    hw/isa/i82378: Remove dead assignment
>>    hw/gpio/aspeed_gpio: Remove dead assignment
>>    hw/timer/exynos4210_mct: Remove dead assignments
>>    hw/timer/stm32f2xx_timer: Remove dead assignment
>>    hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning
>>    hw/scsi/esp-pci: Remove dead assignment
>>
>>   block.c                    | 2 +-
>>   blockdev.c                 | 2 +-
>>   hw/gpio/aspeed_gpio.c      | 2 +-
>>   hw/i2c/pm_smbus.c          | 1 -
>>   hw/ide/sii3112.c           | 5 +++--
>>   hw/input/adb-kbd.c         | 6 +-----
>>   hw/isa/i82378.c            | 8 ++++----
>>   hw/scsi/esp-pci.c          | 1 -
>>   hw/timer/exynos4210_mct.c  | 3 ---
>>   hw/timer/pxa2xx_timer.c    | 1 +
>>   hw/timer/stm32f2xx_timer.c | 1 -
>>   11 files changed, 12 insertions(+), 20 deletions(-)
>>
> 
> I think your series covers cases already covered by:
> 
> [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static
> code analyzer
> https://patchew.org/QEMU/20200302130715.29440-1-kuhn.ch

Unfortunately [for me...] I don't have v3 in my INBOX... *sigh*
This was 3 weeks ago. *sigh*.

I can see the series in the archives:
https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg00219.html
But I can't find the outcome, was it queued in the trivial tree?
Any idea when this will be merged in the master tree?

What a waste of time...

> 
> Thanks,
> Laurent
> 


Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Laurent Vivier 4 years ago
Le 23/03/2020 à 15:45, Philippe Mathieu-Daudé a écrit :
> On 3/23/20 3:32 PM, Laurent Vivier wrote:
>> Le 21/03/2020 à 15:40, Philippe Mathieu-Daudé a écrit :
>>> Fix trivial warnings reported by the Clang static code analyzer.
>>>
>>> Since v1:
>>> - Addressed Markus/Zoltan/Aleksandar review comments
>>>
>>> Philippe Mathieu-Daudé (11):
>>>    block: Avoid dead assignment
>>>    blockdev: Remove dead assignment
>>>    hw/i2c/pm_smbus: Remove dead assignment
>>>    hw/input/adb-kbd: Remove dead assignment
>>>    hw/ide/sii3112: Remove dead assignment
>>>    hw/isa/i82378: Remove dead assignment
>>>    hw/gpio/aspeed_gpio: Remove dead assignment
>>>    hw/timer/exynos4210_mct: Remove dead assignments
>>>    hw/timer/stm32f2xx_timer: Remove dead assignment
>>>    hw/timer/pxa2xx_timer: Add assertion to silent static analyzer
>>> warning
>>>    hw/scsi/esp-pci: Remove dead assignment
>>>
>>>   block.c                    | 2 +-
>>>   blockdev.c                 | 2 +-
>>>   hw/gpio/aspeed_gpio.c      | 2 +-
>>>   hw/i2c/pm_smbus.c          | 1 -
>>>   hw/ide/sii3112.c           | 5 +++--
>>>   hw/input/adb-kbd.c         | 6 +-----
>>>   hw/isa/i82378.c            | 8 ++++----
>>>   hw/scsi/esp-pci.c          | 1 -
>>>   hw/timer/exynos4210_mct.c  | 3 ---
>>>   hw/timer/pxa2xx_timer.c    | 1 +
>>>   hw/timer/stm32f2xx_timer.c | 1 -
>>>   11 files changed, 12 insertions(+), 20 deletions(-)
>>>
>>
>> I think your series covers cases already covered by:
>>
>> [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static
>> code analyzer
>> https://patchew.org/QEMU/20200302130715.29440-1-kuhn.ch
> 
> Unfortunately [for me...] I don't have v3 in my INBOX... *sigh*
> This was 3 weeks ago. *sigh*.
> 
> I can see the series in the archives:
> https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg00219.html
> But I can't find the outcome, was it queued in the trivial tree?
> Any idea when this will be merged in the master tree?

Some patches are already merged via trivial (1, 2 (should go by SCSI
queue) 3, 5, 6, 7, 9, 11 (by USB queue), 12).

But others needed R-b tags or new version. I didn't check which of your
patches are already covered by this series.

I'm sorry to not have checked your series earlier...

Thanks,
Laurent


Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Philippe Mathieu-Daudé 4 years ago
On 3/23/20 3:55 PM, Laurent Vivier wrote:
> Le 23/03/2020 à 15:45, Philippe Mathieu-Daudé a écrit :
>> On 3/23/20 3:32 PM, Laurent Vivier wrote:
>>> Le 21/03/2020 à 15:40, Philippe Mathieu-Daudé a écrit :
>>>> Fix trivial warnings reported by the Clang static code analyzer.
>>>>
>>>> Since v1:
>>>> - Addressed Markus/Zoltan/Aleksandar review comments
>>>>
>>>> Philippe Mathieu-Daudé (11):
>>>>     block: Avoid dead assignment
>>>>     blockdev: Remove dead assignment
>>>>     hw/i2c/pm_smbus: Remove dead assignment
>>>>     hw/input/adb-kbd: Remove dead assignment
>>>>     hw/ide/sii3112: Remove dead assignment
>>>>     hw/isa/i82378: Remove dead assignment
>>>>     hw/gpio/aspeed_gpio: Remove dead assignment
>>>>     hw/timer/exynos4210_mct: Remove dead assignments
>>>>     hw/timer/stm32f2xx_timer: Remove dead assignment
>>>>     hw/timer/pxa2xx_timer: Add assertion to silent static analyzer
>>>> warning
>>>>     hw/scsi/esp-pci: Remove dead assignment
>>>>
>>>>    block.c                    | 2 +-
>>>>    blockdev.c                 | 2 +-
>>>>    hw/gpio/aspeed_gpio.c      | 2 +-
>>>>    hw/i2c/pm_smbus.c          | 1 -
>>>>    hw/ide/sii3112.c           | 5 +++--
>>>>    hw/input/adb-kbd.c         | 6 +-----
>>>>    hw/isa/i82378.c            | 8 ++++----
>>>>    hw/scsi/esp-pci.c          | 1 -
>>>>    hw/timer/exynos4210_mct.c  | 3 ---
>>>>    hw/timer/pxa2xx_timer.c    | 1 +
>>>>    hw/timer/stm32f2xx_timer.c | 1 -
>>>>    11 files changed, 12 insertions(+), 20 deletions(-)
>>>>
>>>
>>> I think your series covers cases already covered by:
>>>
>>> [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static
>>> code analyzer
>>> https://patchew.org/QEMU/20200302130715.29440-1-kuhn.ch
>>
>> Unfortunately [for me...] I don't have v3 in my INBOX... *sigh*
>> This was 3 weeks ago. *sigh*.
>>
>> I can see the series in the archives:
>> https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg00219.html
>> But I can't find the outcome, was it queued in the trivial tree?
>> Any idea when this will be merged in the master tree?
> 
> Some patches are already merged via trivial (1, 2 (should go by SCSI
> queue) 3, 5, 6, 7, 9, 11 (by USB queue), 12).
> 
> But others needed R-b tags or new version. I didn't check which of your
> patches are already covered by this series.
> 
> I'm sorry to not have checked your series earlier...

Don't be sorry, the problem is my INBOX that is unreliable.

I was using NNTP last month until I heard it was working properly again, 
which is not the case apparently. I'll try to find them on NNTP and 
review them.

> 
> Thanks,
> Laurent
> 


RE: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Chenqun (kuhn) 4 years ago
>-----Original Message-----
>From: Qemu-devel [mailto:qemu-devel-
>bounces+kuhn.chenqun=huawei.com@nongnu.org] On Behalf Of Laurent Vivier
>Sent: Monday, March 23, 2020 10:56 PM
>To: Philippe Mathieu-Daudé <philmd@redhat.com>; qemu-devel@nongnu.org
>Cc: Fam Zheng <fam@euphon.net>; Peter Maydell <peter.maydell@linaro.org>;
>Michael S. Tsirkin <mst@redhat.com>; Mark Cave-Ayland <mark.cave-
>ayland@ilande.co.uk>; qemu-block@nongnu.org; qemu-trivial@nongnu.org;
>Markus Armbruster <armbru@redhat.com>; Hervé Poussineau
><hpoussin@reactos.org>; Joel Stanley <joel@jms.id.au>; Michael Tokarev
><mjt@tls.msk.ru>; Alistair Francis <alistair@alistair23.me>; qemu-
>arm@nongnu.org; Cédric Le Goater <clg@kaod.org>; John Snow
><jsnow@redhat.com>; David Gibson <david@gibson.dropbear.id.au>; Kevin Wolf
><kwolf@redhat.com>; Andrew Jeffery <andrew@aj.id.au>; Max Reitz
><mreitz@redhat.com>; Igor Mitsyanko <i.mitsyanko@gmail.com>; qemu-
>ppc@nongnu.org; Paolo Bonzini <pbonzini@redhat.com>
>Subject: Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
>
>Le 23/03/2020 à 15:45, Philippe Mathieu-Daudé a écrit :
>> On 3/23/20 3:32 PM, Laurent Vivier wrote:
>>> Le 21/03/2020 à 15:40, Philippe Mathieu-Daudé a écrit :
>>>> Fix trivial warnings reported by the Clang static code analyzer.
>>>>
>>>> Since v1:
>>>> - Addressed Markus/Zoltan/Aleksandar review comments
>>>>
>>>> Philippe Mathieu-Daudé (11):
>>>>    block: Avoid dead assignment
>>>>    blockdev: Remove dead assignment
>>>>    hw/i2c/pm_smbus: Remove dead assignment
>>>>    hw/input/adb-kbd: Remove dead assignment
>>>>    hw/ide/sii3112: Remove dead assignment
>>>>    hw/isa/i82378: Remove dead assignment
>>>>    hw/gpio/aspeed_gpio: Remove dead assignment
>>>>    hw/timer/exynos4210_mct: Remove dead assignments

Same as this:
https://patchwork.kernel.org/patch/11415527/

>>>>    hw/timer/stm32f2xx_timer: Remove dead assignment
>>>>    hw/timer/pxa2xx_timer: Add assertion to silent static analyzer
>>>> warning
>>>>    hw/scsi/esp-pci: Remove dead assignment

Same as this:
https://patchwork.kernel.org/patch/11415529/

>>>>
>>>>   block.c                    | 2 +-
>>>>   blockdev.c                 | 2 +-
>>>>   hw/gpio/aspeed_gpio.c      | 2 +-
>>>>   hw/i2c/pm_smbus.c          | 1 -
>>>>   hw/ide/sii3112.c           | 5 +++--
>>>>   hw/input/adb-kbd.c         | 6 +-----
>>>>   hw/isa/i82378.c            | 8 ++++----
>>>>   hw/scsi/esp-pci.c          | 1 -
>>>>   hw/timer/exynos4210_mct.c  | 3 ---
>>>>   hw/timer/pxa2xx_timer.c    | 1 +
>>>>   hw/timer/stm32f2xx_timer.c | 1 -
>>>>   11 files changed, 12 insertions(+), 20 deletions(-)
>>>>
>>>
>>> I think your series covers cases already covered by:
>>>
>>> [PATCH v3 00/12] redundant code: Fix warnings reported by Clang
>>> static code analyzer
>>> https://patchew.org/QEMU/20200302130715.29440-1-kuhn.ch
>>
>> Unfortunately [for me...] I don't have v3 in my INBOX... *sigh* This
>> was 3 weeks ago. *sigh*.
>>
>> I can see the series in the archives:
>> https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg00219.html
>> But I can't find the outcome, was it queued in the trivial tree?
>> Any idea when this will be merged in the master tree?
>
>Some patches are already merged via trivial (1, 2 (should go by SCSI
>queue) 3, 5, 6, 7, 9, 11 (by USB queue), 12).
>
>But others needed R-b tags or new version. I didn't check which of your patches
>are already covered by this series.
>
Hi, Laurent and Philippe

      Yes, there are currently three patches( 4、8 、10) that are not merged.  
And, only patch4 and patch10  have the same points as this series.

I should update it again earlier.

Thanks.
Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
On 3/21/20 3:40 PM, Philippe Mathieu-Daudé wrote:
> Fix trivial warnings reported by the Clang static code analyzer.

I forgot to add the official Clang static code analyzer documentation is 
on https://clang-analyzer.llvm.org/ and on Fedora I simply used it as:

$ sudo dnf install clang-analyzer
$ ../configure
$ scan-build make

> 
> Since v1:
> - Addressed Markus/Zoltan/Aleksandar review comments
> 
> Philippe Mathieu-Daudé (11):
>    block: Avoid dead assignment
>    blockdev: Remove dead assignment
>    hw/i2c/pm_smbus: Remove dead assignment
>    hw/input/adb-kbd: Remove dead assignment
>    hw/ide/sii3112: Remove dead assignment
>    hw/isa/i82378: Remove dead assignment
>    hw/gpio/aspeed_gpio: Remove dead assignment
>    hw/timer/exynos4210_mct: Remove dead assignments
>    hw/timer/stm32f2xx_timer: Remove dead assignment
>    hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning
>    hw/scsi/esp-pci: Remove dead assignment
> 
>   block.c                    | 2 +-
>   blockdev.c                 | 2 +-
>   hw/gpio/aspeed_gpio.c      | 2 +-
>   hw/i2c/pm_smbus.c          | 1 -
>   hw/ide/sii3112.c           | 5 +++--
>   hw/input/adb-kbd.c         | 6 +-----
>   hw/isa/i82378.c            | 8 ++++----
>   hw/scsi/esp-pci.c          | 1 -
>   hw/timer/exynos4210_mct.c  | 3 ---
>   hw/timer/pxa2xx_timer.c    | 1 +
>   hw/timer/stm32f2xx_timer.c | 1 -
>   11 files changed, 12 insertions(+), 20 deletions(-)
>