All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-5.1 v2 00/54] various: Fix error-propagation with Coccinelle scripts
@ 2020-04-06 17:46 Philippe Mathieu-Daudé
  2020-04-06 17:46   ` Philippe Mathieu-Daudé
                   ` (55 more replies)
  0 siblings, 56 replies; 95+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-04-06 17:46 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster
  Cc: Peter Maydell, Vladimir Sementsov-Ogievskiy, Philippe Mathieu-Daudé

This series is inspired of Peter Maydell fix [1]:
"hw/arm/xlnx-zynqmp.c: fix some error-handling code",
but grew after v1 [2] review :/

Markus wanted the reviewed patches in 5.0 [3] but it is too late
(and too big :p).  Ideally I would have split it in 4 sub-series
(roughly one with each cocci script) but since I won't have time
to continue this (soon), I'm sending it altogether so interested
can take/follow it.

If a particular patch is worth for 5.0, it can now be cherry-picked
alone, with its cocci script for reference.

Markus: I added the cocci patches to your Error section, I hope
that's fine :)

Regards,

Phil.

[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg691636.html
[2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg692155.html
[3] https://www.mail-archive.com/qemu-devel@nongnu.org/msg694413.html
Supersedes: <20200325191830.16553-1-f4bug@amsat.org>

Philippe Mathieu-Daudé (54):
  various: Remove suspicious '\' character outside of #define in C code
  scripts/coccinelle: Script to simplify DeviceClass error propagation
  hw/arm/allwinner-a10: Move some code from realize() to init()
  hw/arm/aspeed_ast2600: Simplify use of Error*
  hw/arm/aspeed_ast2600: Move some code from realize() to init()
  hw/arm/aspeed_soc: Move some code from realize() to init()
  hw/arm/aspeed_soc: Simplify use of Error*
  hw/arm/fsl-imx6: Simplify checks on 'smp_cpus' count
  hw/arm/fsl-imx6: Move some code from realize() to init()
  hw/arm/fsl-imx31: Move some code from realize() to init()
  hw/arm/msf2-soc: Store MemoryRegion in MSF2State
  hw/arm/stm32f205_soc: Store MemoryRegion in STM32F205State
  hw/arm/stm32f205_soc: Move some code from realize() to init()
  hw/arm/xlnx-zynqmp: Use single propagate_error() call
  hw/arm/xlnx-zynqmp: Split xlnx_zynqmp_create_rpu() as init + realize
  hw/arm/xlnx-zynqmp: Move some code from realize() to init()
  hw/microblaze/xlnx-zynqmp-pmu: Move some code from realize() to init()
  hw/pci-host/pnv_phb3: Move some code from realize() to init()
  hw/riscv/sifive_e: Move some code from realize() to init()
  hw/riscv/sifive_u: Use single type_init()
  hw/riscv/sifive_u: Move some code from realize() to init()
  hw/riscv/sifive_u: Store MemoryRegion in SiFiveUSoCState
  hw/riscv/sifive_u: Move some code from realize() to init()
  hw/riscv/sifive_u: Rename MachineClass::init()
  scripts/coccinelle: Catch missing error_propagate() calls in realize()
  hw/arm/fsl-imx: Add missing error-propagation code
  hw/arm/stm32f*05_soc: Add missing error-propagation code
  hw/arm/aspeed: Add missing error-propagation code
  hw/arm/allwinner-a10: Add missing error-propagation code
  hw/arm/msf2-soc: Add missing error-propagation code
  hw/riscv/sifive: Add missing error-propagation code
  hw/arm/armv7m: Add missing error-propagation code
  hw/intc/arm_gicv3_its_kvm: Add missing error-propagation code
  hw/microblaze/xlnx-zynqmp-pmu: Add missing error-propagation code
  hw/pci-host/pnv_phb3: Add missing error-propagation code
  hw/block/onenand: Add missing error-propagation code
  scripts/coccinelle: Add script to catch missing error_propagate()
    calls
  hw/arm/bcm2835_peripherals: Add missing error-propagation code
  hw/arm/fsl-imx: Add missing error-propagation code
  hw/arm/stm32fx05_soc: Add missing error-propagation code
  hw/dma/xilinx_axidma: Add missing error-propagation code
  hw/i386/x86: Add missing error-propagation code
  hw/mips/cps: Add missing error-propagation code
  hw/misc/macio/macio: Add missing error-propagation code
  hw/net/xilinx_axienet: Add missing error-propagation code
  hw/riscv/sifive_u: Add missing error-propagation code
  hw/sd/milkymist-memcard: Add missing error-propagation code
  scripts/coccinelle: Use &error_abort in TypeInfo::instance_init()
  various: Use &error_abort in instance_init()
  scripts/coccinelle: Find eventually missing error_propagate() calls
  migration/colo: Add missing error-propagation code
  hw/mips/boston: Add missing error-propagation code
  hw/mips/mips_malta: Add missing error-propagation code
  qga/commands-win32: Add missing error-propagation code

 .../add-missing-error_propagate.cocci         |  30 +++++
 .../find-missing-error_propagate.cocci        |  53 ++++++++
 ...implify-init-realize-error_propagate.cocci |  69 ++++++++++
 .../use-error_abort-in-instance_init.cocci    |  52 ++++++++
 .../use-error_propagate-in-realize.cocci      |  54 ++++++++
 include/hw/arm/msf2-soc.h                     |   4 +
 include/hw/arm/stm32f205_soc.h                |   4 +
 include/hw/riscv/sifive_u.h                   |   2 +
 backends/cryptodev-vhost-user.c               |   2 +-
 backends/rng-egd.c                            |   2 +-
 backends/rng-random.c                         |   2 +-
 backends/vhost-user.c                         |   3 +-
 block/replication.c                           |   4 +-
 block/vhdx.c                                  |   8 +-
 dump/dump.c                                   |   2 +-
 hw/arm/allwinner-a10.c                        |  44 +++---
 hw/arm/armv7m.c                               |  12 +-
 hw/arm/aspeed_ast2600.c                       |  93 ++++++++-----
 hw/arm/aspeed_soc.c                           |  27 ++--
 hw/arm/bcm2835_peripherals.c                  |  14 +-
 hw/arm/fsl-imx25.c                            |  14 +-
 hw/arm/fsl-imx31.c                            |   4 +-
 hw/arm/fsl-imx6.c                             |  81 ++++++-----
 hw/arm/msf2-soc.c                             |  42 +++---
 hw/arm/stm32f205_soc.c                        |  38 +++---
 hw/arm/stm32f405_soc.c                        |  10 +-
 hw/arm/vexpress.c                             |   8 +-
 hw/arm/xlnx-zcu102.c                          |   8 +-
 hw/arm/xlnx-zynqmp.c                          | 126 +++++++++---------
 hw/block/fdc.c                                |   4 +-
 hw/block/onenand.c                            |   6 +-
 hw/block/vhost-user-blk.c                     |   2 +-
 hw/block/virtio-blk.c                         |   2 +-
 hw/core/machine.c                             |   6 +-
 hw/cpu/core.c                                 |   4 +-
 hw/display/vga-pci.c                          |   7 +-
 hw/display/xlnx_dp.c                          |   4 +-
 hw/dma/sparc32_dma.c                          |   2 +-
 hw/dma/xilinx_axidma.c                        |   6 +
 hw/gpio/aspeed_gpio.c                         |   2 +-
 hw/i386/x86.c                                 |   4 +
 hw/ide/macio.c                                |   4 +-
 hw/ide/qdev.c                                 |   4 +-
 hw/intc/apic_common.c                         |   2 +-
 hw/intc/arm_gicv3_its_kvm.c                   |   6 +-
 hw/mem/nvdimm.c                               |   4 +-
 hw/microblaze/xlnx-zynqmp-pmu.c               |  52 ++++----
 hw/mips/boston.c                              |  17 +--
 hw/mips/cps.c                                 |  48 +++++++
 hw/mips/mips_malta.c                          |  19 ++-
 hw/misc/aspeed_sdmc.c                         |   2 +-
 hw/misc/edu.c                                 |   3 +-
 hw/misc/macio/macio.c                         |   8 +-
 hw/misc/macio/pmu.c                           |   3 +-
 hw/misc/pca9552.c                             |   2 +-
 hw/misc/tmp105.c                              |   2 +-
 hw/misc/tmp421.c                              |   8 +-
 hw/net/e1000.c                                |   3 +-
 hw/net/lance.c                                |   3 +-
 hw/net/lasi_i82596.c                          |   3 +-
 hw/net/ne2000-isa.c                           |   4 +-
 hw/net/spapr_llan.c                           |   2 +-
 hw/net/virtio-net.c                           |   4 +-
 hw/net/xilinx_axienet.c                       |   6 +
 hw/pci-host/grackle.c                         |   2 +-
 hw/pci-host/i440fx.c                          |   8 +-
 hw/pci-host/pnv_phb3.c                        |  32 +++--
 hw/pci-host/prep.c                            |   2 +-
 hw/pci-host/q35.c                             |  23 ++--
 hw/pci-host/sabre.c                           |   3 +-
 hw/pci-host/uninorth.c                        |   9 +-
 hw/pcmcia/pxa2xx.c                            |   3 +-
 hw/ppc/spapr_drc.c                            |   6 +-
 hw/ppc/spapr_rng.c                            |   2 +-
 hw/riscv/sifive_e.c                           |  32 +++--
 hw/riscv/sifive_u.c                           | 102 ++++++++------
 hw/s390x/event-facility.c                     |   6 +-
 hw/s390x/s390-ccw.c                           |   2 +-
 hw/s390x/s390-skeys.c                         |   4 +-
 hw/s390x/s390-stattrib.c                      |   4 +-
 hw/s390x/sclp.c                               |   2 +-
 hw/scsi/scsi-bus.c                            |   2 +-
 hw/scsi/scsi-disk.c                           |   2 +-
 hw/sd/milkymist-memcard.c                     |   4 +
 hw/sd/sdhci.c                                 |   2 +-
 hw/ssi/xilinx_spips.c                         |   2 +-
 hw/usb/bus.c                                  |   4 +-
 hw/usb/dev-network.c                          |   2 +-
 hw/usb/dev-storage.c                          |   4 +-
 hw/usb/host-libusb.c                          |   2 +-
 hw/usb/redirect.c                             |   2 +-
 hw/virtio/virtio-balloon.c                    |   4 +-
 migration/colo.c                              |   3 +
 net/dump.c                                    |   4 +-
 net/filter-buffer.c                           |   2 +-
 net/filter-mirror.c                           |  10 +-
 net/filter-rewriter.c                         |   3 +-
 qga/commands-win32.c                          |  26 ++--
 target/arm/cpu64.c                            |   4 +-
 target/i386/cpu.c                             |  41 +++---
 target/microblaze/cpu.c                       |  14 +-
 target/ppc/translate_init.inc.c               |   4 +-
 target/s390x/cpu.c                            |   3 +-
 tests/check-qom-proplist.c                    |   7 +-
 tests/test-qdev-global-props.c                |   4 +-
 MAINTAINERS                                   |   5 +
 106 files changed, 1014 insertions(+), 458 deletions(-)
 create mode 100644 scripts/coccinelle/add-missing-error_propagate.cocci
 create mode 100644 scripts/coccinelle/find-missing-error_propagate.cocci
 create mode 100644 scripts/coccinelle/simplify-init-realize-error_propagate.=
cocci
 create mode 100644 scripts/coccinelle/use-error_abort-in-instance_init.cocci
 create mode 100644 scripts/coccinelle/use-error_propagate-in-realize.cocci

--=20
2.21.1



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

end of thread, other threads:[~2020-04-12 22:29 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 17:46 [PATCH-for-5.1 v2 00/54] various: Fix error-propagation with Coccinelle scripts Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 01/54] various: Remove suspicious '\' character outside of #define in C code Philippe Mathieu-Daudé
2020-04-06 17:46   ` Philippe Mathieu-Daudé
2020-04-06 17:57   ` Marc-André Lureau
2020-04-06 17:57     ` Marc-André Lureau
2020-04-06 17:46 ` [PATCH-for-5.1 v2 02/54] scripts/coccinelle: Script to simplify DeviceClass error propagation Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 03/54] hw/arm/allwinner-a10: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 18:00   ` Eric Blake
2020-04-12 22:28     ` Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 04/54] hw/arm/aspeed_ast2600: Simplify use of Error* Philippe Mathieu-Daudé
2020-04-07  6:46   ` Cédric Le Goater
2020-04-06 17:46 ` [PATCH-for-5.1 v2 05/54] hw/arm/aspeed_ast2600: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: " Philippe Mathieu-Daudé
2020-04-07  6:47   ` Cédric Le Goater
2020-04-06 17:46 ` [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error* Philippe Mathieu-Daudé
2020-04-07  6:47   ` Cédric Le Goater
2020-04-06 17:46 ` [PATCH-for-5.1 v2 08/54] hw/arm/fsl-imx6: Simplify checks on 'smp_cpus' count Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 09/54] hw/arm/fsl-imx6: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:46 ` [PATCH-for-5.1 v2 10/54] hw/arm/fsl-imx31: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 11/54] hw/arm/msf2-soc: Store MemoryRegion in MSF2State Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 12/54] hw/arm/stm32f205_soc: Store MemoryRegion in STM32F205State Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 13/54] hw/arm/stm32f205_soc: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 14/54] hw/arm/xlnx-zynqmp: Use single propagate_error() call Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 15/54] hw/arm/xlnx-zynqmp: Split xlnx_zynqmp_create_rpu() as init + realize Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 16/54] hw/arm/xlnx-zynqmp: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 17/54] hw/microblaze/xlnx-zynqmp-pmu: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 18/54] hw/pci-host/pnv_phb3: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 19/54] hw/riscv/sifive_e: " Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 20/54] hw/riscv/sifive_u: Use single type_init() Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 21/54] hw/riscv/sifive_u: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 22/54] hw/riscv/sifive_u: Store MemoryRegion in SiFiveUSoCState Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 23/54] hw/riscv/sifive_u: Move some code from realize() to init() Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 24/54] hw/riscv/sifive_u: Rename MachineClass::init() Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 25/54] scripts/coccinelle: Catch missing error_propagate() calls in realize() Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 26/54] hw/arm/fsl-imx: Add missing error-propagation code Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 27/54] hw/arm/stm32f*05_soc: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 28/54] hw/arm/aspeed: " Philippe Mathieu-Daudé
2020-04-07  6:47   ` Cédric Le Goater
2020-04-06 17:47 ` [PATCH-for-5.1 v2 29/54] hw/arm/allwinner-a10: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 30/54] hw/arm/msf2-soc: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 31/54] hw/riscv/sifive: " Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 32/54] hw/arm/armv7m: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 33/54] hw/intc/arm_gicv3_its_kvm: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 34/54] hw/microblaze/xlnx-zynqmp-pmu: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 35/54] hw/pci-host/pnv_phb3: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 36/54] hw/block/onenand: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 37/54] scripts/coccinelle: Add script to catch missing error_propagate() calls Philippe Mathieu-Daudé
2020-04-06 20:06   ` Eric Blake
2020-04-06 17:47 ` [PATCH-for-5.1 v2 38/54] hw/arm/bcm2835_peripherals: Add missing error-propagation code Philippe Mathieu-Daudé
2020-04-06 17:55   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 39/54] hw/arm/fsl-imx: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 40/54] hw/arm/stm32fx05_soc: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 41/54] hw/dma/xilinx_axidma: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 42/54] hw/i386/x86: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 43/54] hw/mips/cps: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 44/54] hw/misc/macio/macio: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 45/54] hw/net/xilinx_axienet: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 46/54] hw/riscv/sifive_u: " Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 47/54] hw/sd/milkymist-memcard: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 48/54] scripts/coccinelle: Use &error_abort in TypeInfo::instance_init() Philippe Mathieu-Daudé
2020-04-07  7:07   ` Vladimir Sementsov-Ogievskiy
2020-04-07 11:03     ` Philippe Mathieu-Daudé
2020-04-07 13:01       ` Vladimir Sementsov-Ogievskiy
2020-04-07 13:07         ` Philippe Mathieu-Daudé
2020-04-07 17:27           ` Philippe Mathieu-Daudé
2020-04-07 17:54             ` Vladimir Sementsov-Ogievskiy
2020-04-07 18:16               ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 49/54] various: Use &error_abort in instance_init() Philippe Mathieu-Daudé
2020-04-06 17:47   ` Philippe Mathieu-Daudé
2020-04-06 18:19   ` Philippe Mathieu-Daudé
2020-04-06 18:19     ` Philippe Mathieu-Daudé
2020-04-07  6:47   ` Cédric Le Goater
2020-04-07  6:47     ` Cédric Le Goater
2020-04-07 13:27   ` Cornelia Huck
2020-04-07 13:27     ` Cornelia Huck
2020-04-06 17:47 ` [PATCH-for-5.1 v2 50/54] scripts/coccinelle: Find eventually missing error_propagate() calls Philippe Mathieu-Daudé
2020-04-07  7:15   ` Vladimir Sementsov-Ogievskiy
2020-04-06 17:47 ` [PATCH-for-5.1 v2 51/54] migration/colo: Add missing error-propagation code Philippe Mathieu-Daudé
2020-04-07  7:10   ` Juan Quintela
2020-04-06 17:47 ` [PATCH-for-5.1 v2 52/54] hw/mips/boston: " Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 53/54] hw/mips/mips_malta: " Philippe Mathieu-Daudé
2020-04-06 19:27   ` Philippe Mathieu-Daudé
2020-04-07 18:36   ` Richard Henderson
2020-04-12 22:28     ` Philippe Mathieu-Daudé
2020-04-06 17:47 ` [PATCH-for-5.1 v2 54/54] qga/commands-win32: " Philippe Mathieu-Daudé
2020-04-06 20:34 ` [PATCH-for-5.1 v2 00/54] various: Fix error-propagation with Coccinelle scripts no-reply
2020-04-06 20:39 ` no-reply

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.