Skip to content

Clean up header guards again

Markus Armbruster qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5scripts/clean-header-guards: Update exclusionsscripts/clean-header-guards.pl+3 -21 reply
2/5Clean up header guards that don't match their file nameaccel/accel-internal.h accel/tcg/tb-internal.h crypto/tlscredsbox.h +33 more+88 -811 reply
3/5Clean up ill-advised or unusual header guardsbackends/tpm/tpm_ioctl.h bsd-user/bsd-proc.h hw/net/igb_regs.h +12 more+44 -432 replies
4/5Normalize header guard symbol definitioninclude/exec/tlb-common.h include/hw/misc/xlnx-cfi-if.h include/qemu/mem-reentrancy.h+5 -31 reply
5/5Clean up decorations and whitespace around header guardscrypto/akcipherpriv.h crypto/der.h hw/net/e1000x_regs.h +17 more+23 -201 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchDaniel P. BerrangéWarner Losh.
1/5R-b
2/5R-b
3/5R-b R-b
4/5R-b
5/5R-b

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/5] Clean up header guards again

Our use of header guards is rather sloppy. Sloppiness there can lead to confusing compilation errors. This series cleans up existing header guards. In particular, it normalizes guard symbols to follow a common pattern, in the hope of making clashes less likely. It doesn't add new header guards. We have more than 300 headers without a recognizable header guard. A few of them are for multiple inclusion, many don't need header guards because they don't do anything but include, but quite a few probably should have one. Left for another day.

Previously cleaned up in merge commit ec11dc41eec (2022), merge commit 01807c8b0e9 (2019), and merge commit ca3d87d4c84 (2016).

Markus Armbruster (5):
scripts/clean-header-guards: Update exclusions Clean up header guards that don't match their file name Clean up ill-advised or unusual header guards Normalize header guard symbol definition
Clean up decorations and whitespace around header guards

 accel/accel-internal.h                      | 2 +-
 accel/tcg/tb-internal.h                     | 4 ++--
 backends/tpm/tpm_ioctl.h                    | 7 ++++---
 bsd-user/bsd-proc.h                         | 6 +++---
 crypto/akcipherpriv.h                       | 2 +-
 crypto/der.h                                | 2 +-
 crypto/tlscredsbox.h                        | 6 +++---
 hw/i386/tdvf-hob.h                          | 4 ++--
 hw/net/e1000x_regs.h                        | 2 +-
 hw/net/igb_regs.h                           | 4 ++--
 hw/riscv/riscv-iommu-bits.h                 | 2 +-
 hw/riscv/riscv-iommu.h                      | 4 ++--
 include/accel/accel-cpu-target.h            | 2 +-
 include/exec/page-protection.h              | 5 +++--
 include/exec/replay-core.h                  | 4 ++--
 include/exec/target_long.h                  | 6 +++---
 include/exec/tb-flush.h                     | 7 ++++---
 include/exec/tlb-common.h                   | 3 ++-
 include/exec/tswap.h                        | 2 +-
 include/gdbstub/helpers.h                   | 6 +++---
 include/gdbstub/syscalls.h                  | 6 +++---
 include/hw/acpi/ich9_tco.h                  | 6 +++---
 include/hw/arm/raspberrypi-fw-defs.h        | 7 +++----
 include/hw/arm/stm32l4x5_soc.h              | 4 ++--
 include/hw/audio/virtio-snd.h               | 4 ++--
 include/hw/char/max78000_uart.h             | 2 +-
 include/hw/core/hw-error.h                  | 4 ++--
 include/hw/core/qdev.h                      | 4 ++--
 include/hw/core/sysemu-cpu-ops.h            | 6 +++---
 include/hw/fsi/fsi-master.h                 | 3 ++-
 include/hw/gpio/pcf8574.h                   | 6 +++---
 include/hw/intc/loongarch_extioi_common.h   | 2 +-
 include/hw/intc/loongarch_pic_common.h      | 2 +-
 include/hw/loongarch/virt.h                 | 4 ++--
 include/hw/misc/allwinner-a10-ccm.h         | 2 +-
 include/hw/misc/sifive_e_aon.h              | 4 ++--
 include/hw/misc/xlnx-cfi-if.h               | 3 ++-
 include/hw/misc/xlnx-versal-cfu.h           | 5 +++--
 include/hw/net/xlnx-versal-canfd.h          | 4 ++--
 include/hw/pci-bridge/cxl_upstream_port.h   | 7 ++++---
 include/hw/pci-host/fsl_imx8m_phy.h         | 4 ++--
 include/hw/ppc/pnv_n1_chiplet.h             | 2 +-
 include/hw/ppc/pnv_nest_pervasive.h         | 6 +++---
 include/hw/ssi/pnv_spi_regs.h               | 4 ++--
 include/hw/virtio/vdpa-dev.h                | 5 +++--
 include/hw/virtio/vhost-user-gpio.h         | 6 +++---
 include/hw/virtio/vhost-user-scmi.h         | 6 +++---
 include/hw/xen/xen-pvh-common.h             | 4 ++--
 include/io/channel-null.h                   | 4 ++--
 include/qapi/qmp-registry.h                 | 4 ++--
 include/qemu/mem-reentrancy.h               | 2 +-
 include/qemu/target-info-qapi.h             | 4 ++--
 include/semihosting/uaccess.h               | 2 +-
 include/system/cpu-timers-internal.h        | 6 +++---
 include/system/dirtylimit.h                 | 5 +++--
 include/system/ioport.h                     | 2 +-
 include/system/spdm-socket.h                | 4 ++--
 include/tcg/insn-start-words.h              | 6 +++---
 include/tcg/tcg-temp-internal.h             | 2 +-
 include/user/tswap-target.h                 | 5 +++--
 qga/cutils.h                                | 6 +++---
 target/arm/cpu-features.h                   | 4 ++--
 target/arm/tcg/mte_helper.h                 | 6 +++---
 target/hexagon/idef-parser/parser-helpers.h | 2 +-
 target/i386/confidential-guest.h            | 5 +++--
 target/i386/emulate/x86.h                   | 4 ++--
 target/i386/emulate/x86_decode.h            | 4 ++--
 target/i386/emulate/x86_flags.h             | 6 +++---
 target/i386/kvm/xen-compat.h                | 2 +-
 target/loongarch/cpu-mmu.h                  | 2 +-
 target/loongarch/tcg/tcg_loongarch.h        | 4 +++-
 target/riscv/cpu_vendorid.h                 | 2 +-
 target/sparc/translate.h                    | 5 +++--
 target/xtensa/core-lx106/core-isa.h         | 7 +++----
 scripts/clean-header-guards.pl              | 5 +++--
 75 files changed, 163 insertions(+), 149 deletions(-)
Signature · 1 line
2.52.0