Skip to content

cocci: Do not initialize variable used by *FOREACH*() macro

Philippe Mathieu-Daudé qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8cocci: Do not initialize variable used by QLIST_FOREACH macroblock/blkio.c block/gluster.c hw/arm/virt-acpi-build.c +5 more+12 -120 replies
2/8cocci: Do not initialize variable used by QSLIST_FOREACH macroebpf/ebpf.c+1 -10 replies
3/8cocci: Do not initialize variable used by QSIMPLEQ_FOREACH macroblock/blkdebug.c migration/block-dirty-bitmap.c+2 -20 replies
4/8cocci: Do not initialize variable used by QTAILQ_FOREACH macrohw/ppc/spapr.c hw/ppc/spapr_events.c net/colo-compare.c +2 more+7 -70 replies
5/8cocci: Do not initialize variable used by RAMBLOCK_FOREACH* macromigration/dirtyrate.c+2 -20 replies
6/8cocci: Do not initialize variable used by CPU_FOREACH macrohw/misc/mips_cpc.c target/mips/internal.h target/mips/tcg/system/cp0_helper.c +1 more+8 -80 replies
7/8target/mips: Reduce CPUState scope when used with CPU_FOREACH()target/mips/internal.h target/mips/tcg/system/cp0_helper.c target/mips/tcg/system/tlb_helper.c+25 -210 replies
8/8target/riscv: Iterate vCPUs using CPU_FOREACH() macrohw/riscv/boot.c+5 -40 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPierrick Bouvier
SeriesR-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] cocci: Do not initialize variable used by *FOREACH*() macro

Most of our *FOREACH*() macros take a pointer argument, then assign it upon entry before iterating. Thus there is no need to initialize the variable used as argument. But sometimes we do, which is confusing (for example &first_cpu). This series uses a Coccinelle script to clean these unnecessary usages. (and 2 bonus cleanup patches at the end).

Philippe Mathieu-Daudé (8):
cocci: Do not initialize variable used by QLIST_FOREACH macro
cocci: Do not initialize variable used by QSLIST_FOREACH macro
cocci: Do not initialize variable used by QSIMPLEQ_FOREACH macro
cocci: Do not initialize variable used by QTAILQ_FOREACH macro
cocci: Do not initialize variable used by RAMBLOCK_FOREACH* macro
cocci: Do not initialize variable used by CPU_FOREACH macro target/mips: Reduce CPUState scope when used with CPU_FOREACH() target/riscv: Iterate vCPUs using CPU_FOREACH() macro

 target/mips/internal.h              | 11 ++++++-----
 block/blkdebug.c                    |  2 +-
 block/blkio.c                       |  2 +-
 block/gluster.c                     |  4 ++--
 ebpf/ebpf.c                         |  2 +-
 hw/arm/virt-acpi-build.c            |  2 +-
 hw/i386/xen/xen-hvm.c               |  4 ++--
 hw/misc/mips_cpc.c                  |  4 ++--
 hw/ppc/spapr.c                      |  2 +-
 hw/ppc/spapr_events.c               |  4 ++--
 hw/riscv/boot.c                     |  9 +++++----
 hw/riscv/riscv-iommu.c              |  2 +-
 hw/vfio/cpr-legacy.c                |  2 +-
 hw/vfio/listener.c                  |  4 ++--
 hw/xen/xen_pt_config_init.c         |  4 ++--
 migration/block-dirty-bitmap.c      |  2 +-
 migration/dirtyrate.c               |  4 ++--
 net/colo-compare.c                  |  4 ++--
 net/net.c                           |  2 +-
 target/mips/tcg/system/cp0_helper.c | 28 ++++++++++++++++------------
 target/mips/tcg/system/tlb_helper.c |  7 +++----
 target/s390x/kvm/stsi-topology.c    |  2 +-
 22 files changed, 56 insertions(+), 51 deletions(-)
Signature · 1 line
2.53.0