mbox series

[0/2] bulk: Remove pointless QOM casts

Message ID 20230601093452.38972-1-philmd@linaro.org
Headers show
Series bulk: Remove pointless QOM casts | expand

Message

Philippe Mathieu-Daudé June 1, 2023, 9:34 a.m. UTC
As per Markus suggestion in [*], use Coccinelle to remove
pointless QOM cast macro uses. Since we have more than 1000
QOM types, add a script to generate the semantic patch.

[*] https://lore.kernel.org/qemu-devel/87mt1jafjt.fsf@pond.sub.org/

Philippe Mathieu-Daudé (2):
  scripts: Add qom-cast-macro-clean-cocci-gen.py
  bulk: Remove pointless QOM casts

 MAINTAINERS                               |  1 +
 block/nbd.c                               |  4 +-
 chardev/char-pty.c                        |  2 +-
 hw/arm/musicpal.c                         |  2 +-
 hw/arm/xlnx-versal.c                      |  2 +-
 hw/display/vhost-user-gpu.c               |  4 +-
 hw/intc/loongarch_extioi.c                |  6 +--
 hw/m68k/q800.c                            |  2 +-
 hw/pci-host/bonito.c                      |  2 +-
 hw/ppc/pnv_lpc.c                          |  2 +-
 hw/ppc/pnv_occ.c                          |  2 +-
 hw/ppc/pnv_sbe.c                          |  2 +-
 hw/riscv/virt.c                           | 10 ++---
 hw/rx/rx62n.c                             |  2 +-
 hw/scsi/esp-pci.c                         | 18 ++++-----
 hw/sparc/sun4m.c                          |  4 +-
 hw/virtio/virtio-mem-pci.c                |  6 +--
 hw/virtio/virtio-pmem-pci.c               |  6 +--
 migration/fd.c                            |  4 +-
 migration/multifd.c                       |  2 +-
 migration/yank_functions.c                |  4 +-
 nbd/client-connection.c                   |  2 +-
 nbd/server.c                              |  2 +-
 softmmu/qdev-monitor.c                    |  2 +-
 ui/vnc-ws.c                               |  6 +--
 scripts/qom-cast-macro-clean-cocci-gen.py | 49 +++++++++++++++++++++++
 26 files changed, 99 insertions(+), 49 deletions(-)
 create mode 100644 scripts/qom-cast-macro-clean-cocci-gen.py

Comments

Richard Henderson June 1, 2023, 3 p.m. UTC | #1
On 6/1/23 02:34, Philippe Mathieu-Daudé wrote:
> As per Markus suggestion in [*], use Coccinelle to remove
> pointless QOM cast macro uses. Since we have more than 1000
> QOM types, add a script to generate the semantic patch.
> 
> [*]https://lore.kernel.org/qemu-devel/87mt1jafjt.fsf@pond.sub.org/
> 
> Philippe Mathieu-Daudé (2):
>    scripts: Add qom-cast-macro-clean-cocci-gen.py
>    bulk: Remove pointless QOM casts

Cool!

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~