All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards
@ 2016-07-12 14:31 Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 01/18] Use #include "..." for our own headers, <...> for others Markus Armbruster
                   ` (18 more replies)
  0 siblings, 19 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit b35399bb4e9968296a12303b00f9f2066470e987:

  Fix confusing argument names in some common functions (2016-07-12 13:06:08 +0100)

are available in the git repository at:

  git://repo.or.cz/qemu/armbru.git tags/pull-include-2016-07-12

for you to fetch changes up to 82751a32be872e71c22167234ac88ba52bf96a37:

  cris: Fix broken header guard in hw/cris/boot.h (2016-07-12 16:20:46 +0200)

----------------------------------------------------------------
Clean up #include "..." vs <...> and header guards

----------------------------------------------------------------
Markus Armbruster (18):
      Use #include "..." for our own headers, <...> for others
      scripts: New clean-header-guards.pl
      target-*: Clean up cpu.h header guards
      linux-user: Clean up target_syscall.h header guards
      linux-user: Clean up target_cpu.h header guards
      linux-user: Clean up target_signal.h header guards
      linux-user: Clean up target_structs.h header guards
      linux-user: Clean up hostdep.h header guards
      linux-user: Fix broken header guard in syscall_defs.h
      tcg: Clean up tcg-target.h header guards
      spapr_pci: Include spapr.h instead of playing games with #error
      Drop Emacs local variables lists redundant with .dir-locals.el
      Clean up header guards that don't match their file name
      libdecnumber: Don't fool around with guards to avoid #include
      libdecnumber: Don't error out on decNumberLocal.h re-inclusion
      Clean up ill-advised or unusual header guards
      Clean up decorations and whitespace around header guards
      cris: Fix broken header guard in hw/cris/boot.h

 audio/audio.h                            |   3 +-
 audio/audio_int.h                        |   3 +-
 audio/audio_pt_int.h                     |   2 +-
 audio/mixeng.h                           |   3 +-
 block/iscsi.c                            |   1 -
 bsd-user/i386/target_syscall.h           |   2 +-
 bsd-user/sparc/target_syscall.h          |   2 +-
 bsd-user/sparc64/target_syscall.h        |   2 +-
 bsd-user/x86_64/target_syscall.h         |   2 +-
 contrib/ivshmem-client/ivshmem-client.h  |   6 +-
 contrib/ivshmem-server/ivshmem-server.h  |   6 +-
 crypto/block-luks.h                      |   6 +-
 crypto/block-qcow.h                      |   6 +-
 crypto/blockpriv.h                       |   6 +-
 crypto/hash-gcrypt.c                     |   2 +-
 crypto/ivgenpriv.h                       |   6 +-
 crypto/pbkdf-gcrypt.c                    |   2 +-
 crypto/pbkdf-nettle.c                    |   2 +-
 crypto/tlscredspriv.h                    |   7 +-
 exec.c                                   |   2 +-
 fsdev/9p-iov-marshal.h                   |   4 +-
 fsdev/9p-marshal.h                       |   4 +-
 fsdev/file-op-9p.h                       |   6 +-
 hw/9pfs/9p-proxy.h                       |   5 +-
 hw/9pfs/9p-synth.h                       |   4 +-
 hw/9pfs/9p-xattr.h                       |   5 +-
 hw/9pfs/9p.h                             |   4 +-
 hw/9pfs/coth.h                           |   4 +-
 hw/9pfs/virtio-9p.h                      |   4 +-
 hw/alpha/alpha_sys.h                     |   4 +-
 hw/arm/strongarm.h                       |   4 +-
 hw/audio/fmopl.h                         |   4 +-
 hw/audio/gusemu.h                        |   2 +-
 hw/audio/gustate.h                       |   2 +-
 hw/audio/lm4549.h                        |   2 +-
 hw/audio/pl041.h                         |   2 +-
 hw/block/nvme.c                          |   8 +-
 hw/block/xen_blkif.h                     |   6 +-
 hw/char/sclpconsole.c                    |   2 +-
 hw/core/uboot_image.h                    |   6 +-
 hw/cris/boot.h                           |   4 +-
 hw/display/qxl.h                         |   2 +-
 hw/display/vga.h                         |   6 +-
 hw/display/vga_int.h                     |   5 +-
 hw/display/virtio-gpu-3d.c               |   2 +-
 hw/display/virtio-gpu.c                  |   2 +-
 hw/i386/kvm/i8254.c                      |   3 +-
 hw/i386/kvm/pci-assign.c                 |   3 +-
 hw/ide/ahci.c                            |  14 +-
 hw/ide/cmd646.c                          |  10 +-
 hw/ide/core.c                            |  10 +-
 hw/ide/ich.c                             |  14 +-
 hw/ide/isa.c                             |   8 +-
 hw/ide/macio.c                           |   2 +-
 hw/ide/microdrive.c                      |   8 +-
 hw/ide/mmio.c                            |   2 +-
 hw/ide/pci.c                             |  10 +-
 hw/ide/piix.c                            |  10 +-
 hw/ide/qdev.c                            |   4 +-
 hw/ide/via.c                             |  10 +-
 hw/intc/gic_internal.h                   |   2 +-
 hw/intc/gicv3_internal.h                 |   2 +-
 hw/lm32/lm32.h                           |   2 +-
 hw/lm32/milkymist-hw.h                   |   6 +-
 hw/microblaze/boot.h                     |   6 +-
 hw/misc/hyperv_testdev.c                 |   2 +-
 hw/net/e1000_regs.h                      |   7 +-
 hw/net/fsl_etsec/etsec.h                 |   7 +-
 hw/net/fsl_etsec/registers.h             |   6 +-
 hw/net/ne2000.h                          |   2 +-
 hw/net/pcnet.h                           |   2 +-
 hw/net/rocker/rocker.h                   |   6 +-
 hw/net/rocker/rocker_desc.h              |   5 +-
 hw/net/rocker/rocker_fp.h                |   6 +-
 hw/net/rocker/rocker_hw.h                |   6 +-
 hw/net/rocker/rocker_of_dpa.h            |   6 +-
 hw/net/rocker/rocker_tlv.h               |   4 +-
 hw/net/rocker/rocker_world.h             |   6 +-
 hw/net/vmxnet3.h                         |   4 +-
 hw/net/vmxnet_debug.h                    |   6 +-
 hw/pci-bridge/dec.h                      |   4 +-
 hw/pci-bridge/ioh3420.c                  |   9 --
 hw/pci-bridge/xio3130_downstream.c       |   9 --
 hw/pci-bridge/xio3130_upstream.c         |  10 --
 hw/pci-bridge/xio3130_upstream.h         |   2 +-
 hw/ppc/mac.h                             |   7 +-
 hw/ppc/ppc405.h                          |   6 +-
 hw/ppc/spapr_cpu_core.c                  |   4 +-
 hw/ppc/spapr_pci_vfio.c                  |   2 +-
 hw/s390x/css.c                           |   2 +-
 hw/s390x/s390-pci-bus.c                  |   6 +-
 hw/s390x/s390-pci-bus.h                  |   4 +-
 hw/s390x/s390-pci-inst.c                 |   4 +-
 hw/s390x/s390-pci-inst.h                 |   2 +-
 hw/s390x/s390-virtio.h                   |   2 +-
 hw/s390x/sclpquiesce.c                   |   2 +-
 hw/s390x/virtio-ccw.h                    |  20 +--
 hw/scsi/mfi.h                            |   6 +-
 hw/scsi/vhost-scsi.c                     |   4 +-
 hw/scsi/virtio-scsi-dataplane.c          |   6 +-
 hw/scsi/virtio-scsi.c                    |   6 +-
 hw/scsi/vmw_pvscsi.c                     |   2 +-
 hw/sh4/sh7750_regnames.h                 |   6 +-
 hw/sh4/sh7750_regs.h                     |   4 +-
 hw/tpm/tpm_util.h                        |   7 +-
 hw/usb/hcd-ehci.h                        |   5 +-
 hw/usb/xen-usb.c                         |   2 +-
 hw/vfio/common.c                         |   6 +-
 hw/virtio/vhost-backend.c                |   5 +-
 hw/xen/xen-host-pci-device.h             |   2 +-
 hw/xen/xen_pt.h                          |   2 +-
 hw/xenpv/xen_domainbuild.h               |   2 +-
 hw/xtensa/bootparam.h                    |   4 +-
 include/block/blockjob.h                 |   3 +-
 include/block/scsi.h                     |   5 +-
 include/block/thread-pool.h              |   2 +-
 include/crypto/afsplit.h                 |   6 +-
 include/crypto/block.h                   |   6 +-
 include/crypto/cipher.h                  |   6 +-
 include/crypto/desrfb.h                  |   5 +-
 include/crypto/hash.h                    |   6 +-
 include/crypto/init.h                    |   6 +-
 include/crypto/ivgen.h                   |   6 +-
 include/crypto/pbkdf.h                   |   6 +-
 include/crypto/random.h                  |   6 +-
 include/crypto/secret.h                  |   6 +-
 include/crypto/tlscreds.h                |   7 +-
 include/crypto/tlscredsanon.h            |   7 +-
 include/crypto/tlscredsx509.h            |   7 +-
 include/crypto/tlssession.h              |   6 +-
 include/crypto/xts.h                     |   7 +-
 include/disas/bfd.h                      |   6 +-
 include/disas/disas.h                    |   6 +-
 include/elf.h                            |   7 +-
 include/exec/address-spaces.h            |   4 +-
 include/exec/cpu-common.h                |   4 +-
 include/exec/exec-all.h                  |   4 +-
 include/exec/gen-icount.h                |   2 +-
 include/exec/helper-gen.h                |   4 +-
 include/exec/helper-head.h               |   7 +-
 include/exec/helper-proto.h              |   4 +-
 include/exec/helper-tcg.h                |   4 +-
 include/exec/softmmu-semi.h              |   3 +-
 include/exec/tb-context.h                |   4 +-
 include/exec/tb-hash-xx.h                |   9 +-
 include/exec/tb-hash.h                   |   4 +-
 include/exec/user/abitypes.h             |   5 +-
 include/fpu/softfloat.h                  |   2 +-
 include/hw/acpi/acpi.h                   |   3 +-
 include/hw/acpi/aml-build.h              |   4 +-
 include/hw/acpi/cpu_hotplug.h            |   5 +-
 include/hw/arm/arm.h                     |   6 +-
 include/hw/arm/exynos4210.h              |   7 +-
 include/hw/arm/pxa.h                     |   5 +-
 include/hw/arm/soc_dma.h                 |   3 +-
 include/hw/arm/stm32f205_soc.h           |   4 +-
 include/hw/audio/audio.h                 |   4 +-
 include/hw/audio/pcspk.h                 |   2 +-
 include/hw/block/block.h                 |   4 +-
 include/hw/block/flash.h                 |   2 +-
 include/hw/bt.h                          |   2 +-
 include/hw/char/escc.h                   |   2 +-
 include/hw/char/lm32_juart.h             |   2 +-
 include/hw/char/pl011.h                  |   4 +-
 include/hw/char/serial.h                 |   3 +-
 include/hw/cris/etraxfs.h                |   4 +-
 include/hw/cris/etraxfs_dma.h            |   2 +-
 include/hw/display/dpcd.h                |   2 +-
 include/hw/dma/xlnx_dpdma.h              |   2 +-
 include/hw/empty_slot.h                  |   2 +-
 include/hw/fw-path-provider.h            |   2 +-
 include/hw/gpio/imx_gpio.h               |   8 +-
 include/hw/i2c/i2c-ddc.h                 |   6 +-
 include/hw/i2c/imx_i2c.h                 |   8 +-
 include/hw/i2c/pm_smbus.h                |   2 +-
 include/hw/i386/apic_internal.h          |   3 +-
 include/hw/i386/ioapic.h                 |   2 +-
 include/hw/i386/ioapic_internal.h        |   2 +-
 include/hw/ide/ahci.h                    |   2 +-
 include/hw/ide/internal.h                |   4 +-
 include/hw/ide/pci.h                     |   2 +-
 include/hw/input/adb.h                   |   6 +-
 include/hw/input/ps2.h                   |   2 +-
 include/hw/intc/allwinner-a10-pic.h      |   4 +-
 include/hw/intc/mips_gic.h               |   6 +-
 include/hw/isa/i8257.h                   |   1 -
 include/hw/isa/i8259_internal.h          |   2 +-
 include/hw/misc/arm_integrator_debug.h   |   5 +-
 include/hw/misc/auxbus.h                 |   6 +-
 include/hw/misc/mips_cmgcr.h             |   6 +-
 include/hw/misc/tmp105_regs.h            |   5 +-
 include/hw/net/allwinner_emac.h          |   5 +-
 include/hw/nmi.h                         |   2 +-
 include/hw/nvram/openbios_firmware_abi.h |   6 +-
 include/hw/pci-host/apb.h                |   4 +-
 include/hw/pci-host/ppce500.h            |   4 +-
 include/hw/pci-host/spapr.h              |  10 +-
 include/hw/pci/pci_bridge.h              |   2 +-
 include/hw/pci/pci_ids.h                 |   3 +-
 include/hw/pcmcia.h                      |   2 +-
 include/hw/platform-bus.h                |   4 +-
 include/hw/ppc/mac_dbdma.h               |   3 +-
 include/hw/ppc/openpic.h                 |   6 +-
 include/hw/ppc/ppc.h                     |   2 +-
 include/hw/ppc/ppc4xx.h                  |   6 +-
 include/hw/ppc/spapr.h                   |   6 +-
 include/hw/ppc/spapr_drc.h               |   9 +-
 include/hw/ppc/spapr_vio.h               |   7 +-
 include/hw/ppc/xics.h                    |   7 +-
 include/hw/s390x/ebcdic.h                |   6 +-
 include/hw/s390x/event-facility.h        |   2 +-
 include/hw/s390x/ioinst.h                |   4 +-
 include/hw/s390x/s390_flic.h             |   6 +-
 include/hw/s390x/sclp.h                  |   4 +-
 include/hw/s390x/storage-keys.h          |   8 +-
 include/hw/sd/sd.h                       |   7 +-
 include/hw/sh4/sh_intc.h                 |   6 +-
 include/hw/smbios/smbios.h               |   3 +-
 include/hw/sparc/grlib.h                 |   6 +-
 include/hw/ssi/xilinx_spips.h            |   6 +-
 include/hw/stream.h                      |   2 +-
 include/hw/sysbus.h                      |   4 +-
 include/hw/timer/a9gtimer.h              |   6 +-
 include/hw/timer/allwinner-a10-pit.h     |   4 +-
 include/hw/timer/hpet.h                  |   5 +-
 include/hw/timer/i8254.h                 |   2 +-
 include/hw/timer/i8254_internal.h        |   2 +-
 include/hw/timer/m48t59.h                |   6 +-
 include/hw/timer/mc146818rtc.h           |   2 +-
 include/hw/timer/mc146818rtc_regs.h      |   5 +-
 include/hw/timer/mips_gictimer.h         |   6 +-
 include/hw/tricore/tricore.h             |   4 +-
 include/hw/unicore32/puv3.h              |   3 +-
 include/hw/usb/ehci-regs.h               |   2 +-
 include/hw/usb/uhci-regs.h               |   2 +-
 include/hw/vfio/vfio-common.h            |   3 +-
 include/hw/vfio/vfio-platform.h          |   2 +-
 include/hw/vfio/vfio.h                   |   4 +-
 include/hw/virtio/vhost-backend.h        |   7 +-
 include/hw/virtio/virtio-access.h        |   8 +-
 include/hw/virtio/virtio-balloon.h       |   4 +-
 include/hw/virtio/virtio-blk.h           |   4 +-
 include/hw/virtio/virtio-gpu.h           |   4 +-
 include/hw/virtio/virtio-input.h         |   6 +-
 include/hw/virtio/virtio-net.h           |   4 +-
 include/hw/virtio/virtio-rng.h           |   4 +-
 include/hw/virtio/virtio-scsi.h          |   6 +-
 include/hw/virtio/virtio-serial.h        |   5 +-
 include/hw/virtio/virtio.h               |   4 +-
 include/hw/watchdog/wdt_diag288.h        |   2 +-
 include/hw/xen/xen.h                     |   3 +-
 include/hw/xen/xen_backend.h             |   2 +-
 include/hw/xen/xen_common.h              |   4 +-
 include/io/channel-buffer.h              |   6 +-
 include/io/channel-command.h             |   6 +-
 include/io/channel-file.h                |   6 +-
 include/io/channel-socket.h              |   6 +-
 include/io/channel-tls.h                 |   6 +-
 include/io/channel-util.h                |   6 +-
 include/io/channel-watch.h               |   6 +-
 include/io/channel-websock.h             |   6 +-
 include/io/channel.h                     |   6 +-
 include/io/task.h                        |   6 +-
 include/libdecnumber/decContext.h        |   5 +-
 include/libdecnumber/decNumber.h         |   9 +-
 include/libdecnumber/decNumberLocal.h    |   7 +-
 include/libdecnumber/dpd/decimal128.h    |   9 +-
 include/libdecnumber/dpd/decimal32.h     |   9 +-
 include/libdecnumber/dpd/decimal64.h     |   9 +-
 include/migration/block.h                |   6 +-
 include/migration/qemu-file.h            |   4 +-
 include/migration/vmstate.h              |   5 +-
 include/monitor/hmp-target.h             |   7 +-
 include/monitor/monitor.h                |   2 +-
 include/monitor/qdev.h                   |   4 +-
 include/net/vhost-user.h                 |   6 +-
 include/qapi/qmp/dispatch.h              |   5 +-
 include/qapi/qmp/types.h                 |   6 +-
 include/qapi/visitor.h                   |   5 +-
 include/qemu/acl.h                       |  14 +-
 include/qemu/atomic.h                    |   8 +-
 include/qemu/base64.h                    |   6 +-
 include/qemu/bcd.h                       |   2 +-
 include/qemu/buffer.h                    |   6 +-
 include/qemu/config-file.h               |   6 +-
 include/qemu/cutils.h                    |   2 +-
 include/qemu/error-report.h              |   5 +-
 include/qemu/fifo8.h                     |   6 +-
 include/qemu/fprintf-fn.h                |   3 +-
 include/qemu/hbitmap.h                   |   2 +-
 include/qemu/help_option.h               |   2 +-
 include/qemu/host-utils.h                |   3 +-
 include/qemu/id.h                        |   2 +-
 include/qemu/main-loop.h                 |   2 +-
 include/qemu/mmap-alloc.h                |   4 +-
 include/qemu/option.h                    |   4 +-
 include/qemu/option_int.h                |   4 +-
 include/qemu/path.h                      |   2 +-
 include/qemu/queue.h                     |   6 +-
 include/qemu/ratelimit.h                 |   2 +-
 include/qemu/rcu_queue.h                 |   2 +-
 include/qemu/readline.h                  |   2 +-
 include/qemu/seqlock.h                   |   7 +-
 include/qemu/sockets.h                   |   8 +-
 include/qemu/thread-posix.h              |   7 +-
 include/qemu/thread-win32.h              |   7 +-
 include/qemu/thread.h                    |   4 +-
 include/qemu/unicode.h                   |   2 +-
 include/sysemu/balloon.h                 |   4 +-
 include/sysemu/bt.h                      |   4 +-
 include/sysemu/device_tree.h             |   6 +-
 include/sysemu/hostmem.h                 |   5 +-
 include/sysemu/tpm_backend.h             |   4 +-
 include/sysemu/tpm_backend_int.h         |   7 +-
 include/sysemu/xen-mapcache.h            |   3 +-
 include/trace-tcg.h                      |   2 +-
 include/trace.h                          |   2 +-
 linux-user/aarch64/target_cpu.h          |   4 +-
 linux-user/aarch64/target_signal.h       |   6 +-
 linux-user/aarch64/target_structs.h      |   4 +-
 linux-user/aarch64/target_syscall.h      |   6 +-
 linux-user/alpha/target_cpu.h            |   4 +-
 linux-user/alpha/target_signal.h         |   6 +-
 linux-user/alpha/target_structs.h        |   4 +-
 linux-user/alpha/target_syscall.h        |   6 +-
 linux-user/arm/nwfpe/fpa11.h             |   7 +-
 linux-user/arm/nwfpe/fpopcode.h          |   4 +-
 linux-user/arm/nwfpe/fpsr.h              |   4 +-
 linux-user/arm/target_cpu.h              |   4 +-
 linux-user/arm/target_signal.h           |   6 +-
 linux-user/arm/target_structs.h          |   4 +-
 linux-user/arm/target_syscall.h          |   6 +-
 linux-user/cris/target_cpu.h             |   4 +-
 linux-user/cris/target_signal.h          |   6 +-
 linux-user/cris/target_structs.h         |   4 +-
 linux-user/cris/target_syscall.h         |   4 +-
 linux-user/flatload.c                    |   2 +-
 linux-user/host/aarch64/hostdep.h        |   4 +-
 linux-user/host/arm/hostdep.h            |   4 +-
 linux-user/host/i386/hostdep.h           |   4 +-
 linux-user/host/ia64/hostdep.h           |   4 +-
 linux-user/host/mips/hostdep.h           |   4 +-
 linux-user/host/ppc/hostdep.h            |   4 +-
 linux-user/host/ppc64/hostdep.h          |   4 +-
 linux-user/host/s390/hostdep.h           |   4 +-
 linux-user/host/s390x/hostdep.h          |   4 +-
 linux-user/host/sparc/hostdep.h          |   4 +-
 linux-user/host/sparc64/hostdep.h        |   4 +-
 linux-user/host/x32/hostdep.h            |   4 +-
 linux-user/host/x86_64/hostdep.h         |   4 +-
 linux-user/i386/target_cpu.h             |   6 +-
 linux-user/i386/target_signal.h          |   6 +-
 linux-user/i386/target_structs.h         |   4 +-
 linux-user/i386/target_syscall.h         |   6 +-
 linux-user/linux_loop.h                  |   5 +-
 linux-user/m68k/target_cpu.h             |   4 +-
 linux-user/m68k/target_signal.h          |   6 +-
 linux-user/m68k/target_structs.h         |   4 +-
 linux-user/m68k/target_syscall.h         |   6 +-
 linux-user/microblaze/target_cpu.h       |   4 +-
 linux-user/microblaze/target_signal.h    |   6 +-
 linux-user/microblaze/target_structs.h   |   4 +-
 linux-user/microblaze/target_syscall.h   |   4 +-
 linux-user/mips/target_cpu.h             |   4 +-
 linux-user/mips/target_signal.h          |   6 +-
 linux-user/mips/target_structs.h         |   4 +-
 linux-user/mips/target_syscall.h         |   6 +-
 linux-user/mips64/target_signal.h        |   6 +-
 linux-user/mips64/target_syscall.h       |   6 +-
 linux-user/openrisc/target_cpu.h         |   4 +-
 linux-user/openrisc/target_signal.h      |   6 +-
 linux-user/openrisc/target_structs.h     |   4 +-
 linux-user/openrisc/target_syscall.h     |   6 +-
 linux-user/ppc/target_cpu.h              |   4 +-
 linux-user/ppc/target_signal.h           |   6 +-
 linux-user/ppc/target_structs.h          |   4 +-
 linux-user/ppc/target_syscall.h          |   6 +-
 linux-user/s390x/target_cpu.h            |   4 +-
 linux-user/s390x/target_signal.h         |   6 +-
 linux-user/s390x/target_structs.h        |   4 +-
 linux-user/s390x/target_syscall.h        |   6 +-
 linux-user/sh4/target_cpu.h              |   4 +-
 linux-user/sh4/target_signal.h           |   6 +-
 linux-user/sh4/target_structs.h          |   4 +-
 linux-user/sh4/target_syscall.h          |   6 +-
 linux-user/sparc/target_cpu.h            |   4 +-
 linux-user/sparc/target_signal.h         |   6 +-
 linux-user/sparc/target_structs.h        |   4 +-
 linux-user/sparc/target_syscall.h        |   6 +-
 linux-user/sparc64/target_signal.h       |   6 +-
 linux-user/sparc64/target_structs.h      |   4 +-
 linux-user/sparc64/target_syscall.h      |   6 +-
 linux-user/syscall_defs.h                |   7 +-
 linux-user/tilegx/syscall_nr.h           |   4 +-
 linux-user/tilegx/target_cpu.h           |   4 +-
 linux-user/tilegx/target_signal.h        |   6 +-
 linux-user/tilegx/target_structs.h       |   4 +-
 linux-user/tilegx/target_syscall.h       |   4 +-
 linux-user/uname.h                       |   4 +-
 linux-user/unicore32/target_cpu.h        |   4 +-
 linux-user/unicore32/target_signal.h     |   6 +-
 linux-user/unicore32/target_structs.h    |   4 +-
 linux-user/unicore32/target_syscall.h    |   8 +-
 linux-user/x86_64/target_signal.h        |   6 +-
 linux-user/x86_64/target_structs.h       |   4 +-
 linux-user/x86_64/target_syscall.h       |   6 +-
 monitor.c                                |  11 +-
 net/tap-linux.h                          |   2 +-
 net/tap_int.h                            |   6 +-
 qemu-options.h                           |   4 +-
 qga/service-win32.h                      |   5 +-
 qga/vss-win32/install.cpp                |   3 +-
 qga/vss-win32/provider.cpp               |   4 +-
 qga/vss-win32/requester.cpp              |   4 +-
 qga/vss-win32/vss-common.h               |   6 +-
 scripts/clean-header-guards.pl           | 213 +++++++++++++++++++++++++++++++
 slirp/bootp.c                            |   2 +-
 slirp/bootp.h                            |   3 +-
 slirp/cksum.c                            |   2 +-
 slirp/if.c                               |   2 +-
 slirp/if.h                               |   4 +-
 slirp/ip.h                               |   4 +-
 slirp/ip6.h                              |   4 +-
 slirp/ip6_icmp.h                         |   4 +-
 slirp/ip_icmp.h                          |   4 +-
 slirp/ip_input.c                         |   2 +-
 slirp/ip_output.c                        |   2 +-
 slirp/libslirp.h                         |   4 +-
 slirp/main.h                             |   3 +-
 slirp/mbuf.c                             |   2 +-
 slirp/mbuf.h                             |   4 +-
 slirp/misc.c                             |   5 +-
 slirp/misc.h                             |   4 +-
 slirp/sbuf.c                             |   4 +-
 slirp/sbuf.h                             |   4 +-
 slirp/slirp.h                            |   4 +-
 slirp/socket.c                           |   2 +-
 slirp/socket.h                           |   6 +-
 slirp/tcp.h                              |   4 +-
 slirp/tcp_input.c                        |   2 +-
 slirp/tcp_output.c                       |   2 +-
 slirp/tcp_subr.c                         |   2 +-
 slirp/tcp_timer.c                        |   2 +-
 slirp/tcp_timer.h                        |   4 +-
 slirp/tcp_var.h                          |   4 +-
 slirp/tcpip.h                            |   4 +-
 slirp/tftp.c                             |   2 +-
 slirp/tftp.h                             |   3 +-
 slirp/udp.c                              |   2 +-
 slirp/udp.h                              |   4 +-
 target-alpha/cpu.h                       |   6 +-
 target-arm/arm-powerctl.c                |   4 +-
 target-arm/cpu.h                         |   4 +-
 target-arm/psci.c                        |   8 +-
 target-cris/cpu.h                        |   5 +-
 target-cris/crisv32-decode.h             |   3 +-
 target-i386/cpu.h                        |   7 +-
 target-i386/hyperv.h                     |   4 +-
 target-i386/svm.h                        |   4 +-
 target-lm32/cpu.h                        |   4 +-
 target-m68k/cpu.h                        |   5 +-
 target-microblaze/cpu.h                  |   5 +-
 target-mips/cpu.h                        |   6 +-
 target-mips/kvm_mips.h                   |   6 +-
 target-mips/mips-defs.h                  |   6 +-
 target-moxie/cpu.h                       |   7 +-
 target-openrisc/cpu.h                    |   6 +-
 target-openrisc/exception.h              |   6 +-
 target-ppc/cpu.h                         |   7 +-
 target-ppc/helper_regs.h                 |   6 +-
 target-ppc/kvm_ppc.h                     |   6 +-
 target-ppc/mmu-hash32.h                  |   6 +-
 target-ppc/mmu-hash64.h                  |   6 +-
 target-ppc/translate_init.c              |   2 +-
 target-s390x/cpu.h                       |   7 +-
 target-sh4/cpu.h                         |   7 +-
 target-sparc/cpu.h                       |   4 +-
 target-tilegx/cpu.h                      |   5 +-
 target-tilegx/opcode_tilegx.h            |   6 +-
 target-tricore/cpu-qom.h                 |   2 +-
 target-tricore/cpu.h                     |   7 +-
 target-tricore/tricore-defs.h            |   6 +-
 target-unicore32/cpu.h                   |   7 +-
 target-unicore32/softmmu.c               |   2 +-
 target-xtensa/core-dc232b/core-isa.h     |   7 +-
 target-xtensa/core-dc233c/core-isa.h     |   7 +-
 target-xtensa/core-fsf/core-isa.h        |   7 +-
 target-xtensa/cpu.h                      |   4 +-
 tcg/aarch64/tcg-target.h                 |   6 +-
 tcg/arm/tcg-target.h                     |   5 +-
 tcg/i386/tcg-target.h                    |   5 +-
 tcg/ia64/tcg-target.h                    |   5 +-
 tcg/mips/tcg-target.h                    |   5 +-
 tcg/ppc/tcg-target.h                     |   5 +-
 tcg/s390/tcg-target.h                    |   5 +-
 tcg/sparc/tcg-target.h                   |   5 +-
 tcg/tci/tcg-target.h                     |   3 +-
 tests/boot-sector.h                      |   6 +-
 tests/libqos/ahci.h                      |   4 +-
 tests/libqos/libqos-pc.h                 |   4 +-
 tests/libqos/libqos.h                    |   4 +-
 tests/postcopy-test.c                    |   3 +-
 tests/tcg/xtensa/linker.ld.S             |   2 +-
 tests/vhost-user-bridge.c                |   2 -
 tests/vhost-user-test.c                  |   2 +-
 trace/control-internal.h                 |   4 +-
 trace/control.h                          |   2 +-
 trace/event-internal.h                   |   2 +-
 trace/ftrace.h                           |   4 +-
 trace/mem-internal.h                     |   2 +-
 trace/mem.h                              |   2 +-
 ui/curses_keys.h                         |   2 +-
 ui/keymaps.h                             |   6 +-
 ui/sdl_zoom.h                            |   6 +-
 ui/vnc-auth-sasl.h                       |   9 +-
 ui/vnc-auth-vencrypt.h                   |   7 +-
 ui/vnc-enc-tight.h                       |   6 +-
 ui/vnc-enc-zrle.h                        |   4 +-
 ui/vnc-enc-zywrle.h                      |   4 +-
 ui/vnc-ws.h                              |   6 +-
 ui/vnc.h                                 |   6 +-
 util/acl.c                               |   9 --
 util/mmap-alloc.c                        |   3 +-
 util/oslib-posix.c                       |   2 +-
 524 files changed, 1418 insertions(+), 1226 deletions(-)
 create mode 100755 scripts/clean-header-guards.pl

-- 
2.5.5

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

* [Qemu-devel] [PULL 01/18] Use #include "..." for our own headers, <...> for others
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 02/18] scripts: New clean-header-guards.pl Markus Armbruster
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Tracked down with an ugly, brittle and probably buggy Perl script.

Also move includes converted to <...> up so they get included before
ours where that's obviously okay.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 block/iscsi.c                     |  1 -
 crypto/hash-gcrypt.c              |  2 +-
 crypto/pbkdf-gcrypt.c             |  2 +-
 crypto/pbkdf-nettle.c             |  2 +-
 exec.c                            |  2 +-
 hw/block/nvme.c                   |  8 ++++----
 hw/char/sclpconsole.c             |  2 +-
 hw/display/vga_int.h              |  2 +-
 hw/display/virtio-gpu-3d.c        |  2 +-
 hw/display/virtio-gpu.c           |  2 +-
 hw/i386/kvm/i8254.c               |  3 ++-
 hw/i386/kvm/pci-assign.c          |  3 ++-
 hw/ide/ahci.c                     | 14 +++++++-------
 hw/ide/cmd646.c                   | 10 +++++-----
 hw/ide/core.c                     | 10 +++++-----
 hw/ide/ich.c                      | 14 +++++++-------
 hw/ide/isa.c                      |  8 ++++----
 hw/ide/macio.c                    |  2 +-
 hw/ide/microdrive.c               |  8 ++++----
 hw/ide/mmio.c                     |  2 +-
 hw/ide/pci.c                      | 10 +++++-----
 hw/ide/piix.c                     | 10 +++++-----
 hw/ide/qdev.c                     |  4 ++--
 hw/ide/via.c                      | 10 +++++-----
 hw/misc/hyperv_testdev.c          |  2 +-
 hw/ppc/spapr_cpu_core.c           |  4 ++--
 hw/ppc/spapr_pci_vfio.c           |  2 +-
 hw/s390x/css.c                    |  2 +-
 hw/s390x/s390-pci-bus.c           |  6 +++---
 hw/s390x/s390-pci-bus.h           |  4 ++--
 hw/s390x/s390-pci-inst.c          |  4 ++--
 hw/s390x/s390-pci-inst.h          |  2 +-
 hw/s390x/sclpquiesce.c            |  2 +-
 hw/s390x/virtio-ccw.h             | 20 ++++++++++----------
 hw/scsi/vhost-scsi.c              |  4 ++--
 hw/scsi/virtio-scsi-dataplane.c   |  6 +++---
 hw/scsi/virtio-scsi.c             |  6 +++---
 hw/scsi/vmw_pvscsi.c              |  2 +-
 hw/usb/xen-usb.c                  |  2 +-
 hw/vfio/common.c                  |  6 +++---
 hw/virtio/vhost-backend.c         |  5 ++---
 include/exec/helper-gen.h         |  2 +-
 include/exec/helper-proto.h       |  2 +-
 include/exec/helper-tcg.h         |  2 +-
 include/exec/tb-hash-xx.h         |  2 +-
 include/hw/gpio/imx_gpio.h        |  2 +-
 include/hw/i2c/imx_i2c.h          |  2 +-
 include/hw/ide/ahci.h             |  2 +-
 include/hw/ide/internal.h         |  4 ++--
 include/hw/ide/pci.h              |  2 +-
 include/hw/ppc/spapr_drc.h        |  2 +-
 include/hw/s390x/event-facility.h |  2 +-
 include/hw/s390x/sclp.h           |  4 ++--
 include/hw/s390x/storage-keys.h   |  2 +-
 include/migration/vmstate.h       |  2 +-
 include/qemu/seqlock.h            |  4 ++--
 include/qemu/thread-posix.h       |  3 ++-
 include/qemu/thread-win32.h       |  3 ++-
 linux-user/arm/nwfpe/fpa11.h      |  3 +--
 linux-user/flatload.c             |  2 +-
 monitor.c                         |  2 +-
 qga/vss-win32/install.cpp         |  3 +--
 qga/vss-win32/provider.cpp        |  4 ++--
 qga/vss-win32/requester.cpp       |  4 ++--
 qga/vss-win32/vss-common.h        |  2 +-
 slirp/bootp.c                     |  2 +-
 slirp/cksum.c                     |  2 +-
 slirp/if.c                        |  2 +-
 slirp/ip_input.c                  |  2 +-
 slirp/ip_output.c                 |  2 +-
 slirp/mbuf.c                      |  2 +-
 slirp/misc.c                      |  5 ++---
 slirp/sbuf.c                      |  4 ++--
 slirp/socket.c                    |  2 +-
 slirp/tcp_input.c                 |  2 +-
 slirp/tcp_output.c                |  2 +-
 slirp/tcp_subr.c                  |  2 +-
 slirp/tcp_timer.c                 |  2 +-
 slirp/tftp.c                      |  2 +-
 slirp/udp.c                       |  2 +-
 target-arm/arm-powerctl.c         |  4 ++--
 target-arm/psci.c                 |  8 ++++----
 target-ppc/translate_init.c       |  2 +-
 target-s390x/cpu.h                |  2 +-
 target-unicore32/softmmu.c        |  2 +-
 tests/postcopy-test.c             |  3 +--
 tests/tcg/xtensa/linker.ld.S      |  2 +-
 tests/vhost-user-bridge.c         |  2 --
 tests/vhost-user-test.c           |  2 +-
 util/mmap-alloc.c                 |  3 ++-
 util/oslib-posix.c                |  2 +-
 91 files changed, 169 insertions(+), 172 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 24f78a7..434cb37 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -46,7 +46,6 @@
 
 #ifdef __linux__
 #include <scsi/sg.h>
-#include <block/scsi.h>
 #endif
 
 typedef struct IscsiLun {
diff --git a/crypto/hash-gcrypt.c b/crypto/hash-gcrypt.c
index 8ea5aff..ed6f842 100644
--- a/crypto/hash-gcrypt.c
+++ b/crypto/hash-gcrypt.c
@@ -19,9 +19,9 @@
  */
 
 #include "qemu/osdep.h"
+#include <gcrypt.h>
 #include "qapi/error.h"
 #include "crypto/hash.h"
-#include "gcrypt.h"
 
 
 static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG__MAX] = {
diff --git a/crypto/pbkdf-gcrypt.c b/crypto/pbkdf-gcrypt.c
index 997b311..34af3a9 100644
--- a/crypto/pbkdf-gcrypt.c
+++ b/crypto/pbkdf-gcrypt.c
@@ -19,9 +19,9 @@
  */
 
 #include "qemu/osdep.h"
+#include <gcrypt.h>
 #include "qapi/error.h"
 #include "crypto/pbkdf.h"
-#include "gcrypt.h"
 
 bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
 {
diff --git a/crypto/pbkdf-nettle.c b/crypto/pbkdf-nettle.c
index db9fc15..d681a60 100644
--- a/crypto/pbkdf-nettle.c
+++ b/crypto/pbkdf-nettle.c
@@ -19,9 +19,9 @@
  */
 
 #include "qemu/osdep.h"
+#include <nettle/pbkdf2.h>
 #include "qapi/error.h"
 #include "crypto/pbkdf.h"
-#include "nettle/pbkdf2.h"
 
 
 bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
diff --git a/exec.c b/exec.c
index 0122ef7..011babd 100644
--- a/exec.c
+++ b/exec.c
@@ -36,7 +36,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #if defined(CONFIG_USER_ONLY)
-#include <qemu.h>
+#include "qemu.h"
 #else /* !CONFIG_USER_ONLY */
 #include "hw/hw.h"
 #include "exec/memory.h"
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 9faad29..280d54d 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -21,10 +21,10 @@
  */
 
 #include "qemu/osdep.h"
-#include <hw/block/block.h>
-#include <hw/hw.h>
-#include <hw/pci/msix.h>
-#include <hw/pci/pci.h>
+#include "hw/block/block.h"
+#include "hw/hw.h"
+#include "hw/pci/msix.h"
+#include "hw/pci/pci.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 15a5b2b..d224648 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <hw/qdev.h>
+#include "hw/qdev.h"
 #include "qemu/thread.h"
 #include "qemu/error-report.h"
 
diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 3ce5544..29a5c03 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -24,7 +24,7 @@
 #ifndef HW_VGA_INT_H
 #define HW_VGA_INT_H 1
 
-#include <hw/hw.h>
+#include "hw/hw.h"
 #include "exec/memory.h"
 
 #define ST01_V_RETRACE      0x08
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index d6c8c6e..758d33a 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -21,7 +21,7 @@
 
 #ifdef CONFIG_VIRGL
 
-#include "virglrenderer.h"
+#include <virglrenderer.h>
 
 static struct virgl_renderer_callbacks virtio_gpu_3d_cbs;
 
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index f8b0274..929c3c8 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -28,7 +28,7 @@ static struct virtio_gpu_simple_resource*
 virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);
 
 #ifdef CONFIG_VIRGL
-#include "virglrenderer.h"
+#include <virglrenderer.h>
 #define VIRGL(_g, _virgl, _simple, ...)                     \
     do {                                                    \
         if (_g->use_virgl_renderer) {                       \
diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c
index 734992e..521a584 100644
--- a/hw/i386/kvm/i8254.c
+++ b/hw/i386/kvm/i8254.c
@@ -22,14 +22,15 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include <linux/kvm.h>
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/i8254.h"
 #include "hw/timer/i8254_internal.h"
 #include "sysemu/kvm.h"
-#include "linux/kvm.h"
 
 #define KVM_PIT_REINJECT_BIT 0
 
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 3623aa1..1a429e5 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -20,7 +20,9 @@
  *  Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com)
  *  Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com)
  */
+
 #include "qemu/osdep.h"
+#include <linux/kvm.h>
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
@@ -32,7 +34,6 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
-#include "linux/kvm.h"
 #include "kvm_i386.h"
 #include "hw/pci/pci-assign.h"
 
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index b1a7b65..bcb9ff9 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -22,17 +22,17 @@
  */
 
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/pci/msi.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
+#include "hw/hw.h"
+#include "hw/pci/msi.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
 
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
-#include <hw/ide/internal.h>
-#include <hw/ide/pci.h>
-#include <hw/ide/ahci.h>
+#include "hw/ide/internal.h"
+#include "hw/ide/pci.h"
+#include "hw/ide/ahci.h"
 
 #define DEBUG_AHCI 0
 
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 49294a5..9ebb8d4 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -23,15 +23,15 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/pci.h>
+#include "hw/ide/pci.h"
 
 /* CMD646 specific */
 #define CFR		0x50
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 029f6b9..f2d131b 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -23,10 +23,10 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
@@ -35,7 +35,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/cutils.h"
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 /* These values were based on a Seagate ST3500418AS but have been modified
    to make more sense in QEMU */
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 920ec27..4599169 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -61,15 +61,15 @@
  */
 
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/pci/msi.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/pci/msi.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
-#include <hw/ide/pci.h>
-#include <hw/ide/ahci.h>
+#include "hw/ide/pci.h"
+#include "hw/ide/ahci.h"
 
 #define ICH9_MSI_CAP_OFFSET     0x80
 #define ICH9_SATA_CAP_OFFSET    0xA8
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index eba567c..40213d6 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -23,13 +23,13 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 /***********************************************************/
 /* ISA IDE definitions */
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 56cc506..5a326af 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -29,7 +29,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 /* debug MACIO */
 // #define DEBUG_MACIO
diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c
index 5c9db80..e3fd30e 100644
--- a/hw/ide/microdrive.c
+++ b/hw/ide/microdrive.c
@@ -23,13 +23,13 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pcmcia.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pcmcia.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 #define TYPE_MICRODRIVE "microdrive"
 #define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRIVE)
diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c
index 493f65a..6f12f45 100644
--- a/hw/ide/mmio.c
+++ b/hw/ide/mmio.c
@@ -28,7 +28,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 /***********************************************************/
 /* MMIO based ide port
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 8d56a00..3cfb510 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -23,14 +23,14 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 #include "qemu/error-report.h"
-#include <hw/ide/pci.h>
+#include "hw/ide/pci.h"
 
 #define BMDMA_PAGE_SIZE 4096
 
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 6d76ce9..c190fca 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -24,15 +24,15 @@
  */
 
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/pci.h>
+#include "hw/ide/pci.h"
 
 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size)
 {
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 6842a55..d07b44e 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -17,11 +17,11 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
+#include "hw/hw.h"
 #include "sysemu/dma.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/block/block.h"
diff --git a/hw/ide/via.c b/hw/ide/via.c
index d3f7226..5b32ecb 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -24,15 +24,15 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <hw/hw.h>
-#include <hw/i386/pc.h>
-#include <hw/pci/pci.h>
-#include <hw/isa/isa.h>
+#include "hw/hw.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
+#include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
 
-#include <hw/ide/pci.h>
+#include "hw/ide/pci.h"
 
 static uint64_t bmdma_read(void *opaque, hwaddr addr,
                            unsigned size)
diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c
index 1883fd7..6cae9e9 100644
--- a/hw/misc/hyperv_testdev.c
+++ b/hw/misc/hyperv_testdev.c
@@ -12,11 +12,11 @@
  */
 
 #include "qemu/osdep.h"
+#include <linux/kvm.h>
 #include "hw/hw.h"
 #include "hw/qdev.h"
 #include "hw/isa/isa.h"
 #include "sysemu/kvm.h"
-#include "linux/kvm.h"
 #include "target-i386/hyperv.h"
 #include "kvm_i386.h"
 
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 70b6b0b..9347f07 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -12,11 +12,11 @@
 #include "hw/ppc/spapr.h"
 #include "hw/boards.h"
 #include "qapi/error.h"
-#include <sysemu/cpus.h>
+#include "sysemu/cpus.h"
 #include "target-ppc/kvm_ppc.h"
 #include "hw/ppc/ppc.h"
 #include "target-ppc/mmu-hash64.h"
-#include <sysemu/numa.h>
+#include "sysemu/numa.h"
 
 static void spapr_cpu_reset(void *opaque)
 {
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index f3cb141..8448e0b 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -18,13 +18,13 @@
  */
 
 #include "qemu/osdep.h"
+#include <linux/vfio.h>
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/ppc/spapr.h"
 #include "hw/pci-host/spapr.h"
 #include "hw/pci/msix.h"
-#include "linux/vfio.h"
 #include "hw/vfio/vfio.h"
 #include "qemu/error-report.h"
 #include "sysemu/qtest.h"
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 54991f5..aa61773 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -12,7 +12,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
-#include <hw/qdev.h>
+#include "hw/qdev.h"
 #include "qemu/bitops.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 640a4ea..47ca853 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -18,9 +18,9 @@
 #include "cpu.h"
 #include "s390-pci-bus.h"
 #include "s390-pci-inst.h"
-#include <hw/pci/pci_bus.h>
-#include <hw/pci/msi.h>
-#include <qemu/error-report.h>
+#include "hw/pci/pci_bus.h"
+#include "hw/pci/msi.h"
+#include "qemu/error-report.h"
 
 /* #define DEBUG_S390PCI_BUS */
 #ifdef DEBUG_S390PCI_BUS
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index f1fbd3c..4f564e0 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -14,8 +14,8 @@
 #ifndef HW_S390_PCI_BUS_H
 #define HW_S390_PCI_BUS_H
 
-#include <hw/pci/pci.h>
-#include <hw/pci/pci_host.h>
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 #include "hw/s390x/sclp.h"
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/css.h"
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 331bc4c..f069b11 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -16,8 +16,8 @@
 #include "cpu.h"
 #include "s390-pci-inst.h"
 #include "s390-pci-bus.h"
-#include <exec/memory-internal.h>
-#include <qemu/error-report.h>
+#include "exec/memory-internal.h"
+#include "qemu/error-report.h"
 
 /* #define DEBUG_S390PCI_INST */
 #ifdef DEBUG_S390PCI_INST
diff --git a/hw/s390x/s390-pci-inst.h b/hw/s390x/s390-pci-inst.h
index e1c2ee1..23f4bfa 100644
--- a/hw/s390x/s390-pci-inst.h
+++ b/hw/s390x/s390-pci-inst.h
@@ -15,7 +15,7 @@
 #define HW_S390_PCI_INST_H
 
 #include "s390-pci-bus.h"
-#include <sysemu/dma.h>
+#include "sysemu/dma.h"
 
 /* CLP common request & response block size */
 #define CLP_BLK_SIZE 4096
diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c
index c0ecab9..762cb18 100644
--- a/hw/s390x/sclpquiesce.c
+++ b/hw/s390x/sclpquiesce.c
@@ -12,7 +12,7 @@
  *
  */
 #include "qemu/osdep.h"
-#include <hw/qdev.h>
+#include "hw/qdev.h"
 #include "sysemu/sysemu.h"
 #include "hw/s390x/sclp.h"
 #include "hw/s390x/event-facility.h"
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 3f76443..1c6bc86 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -13,19 +13,19 @@
 #ifndef HW_S390X_VIRTIO_CCW_H
 #define HW_S390X_VIRTIO_CCW_H
 
-#include <hw/virtio/virtio-blk.h>
-#include <hw/virtio/virtio-net.h>
-#include <hw/virtio/virtio-serial.h>
-#include <hw/virtio/virtio-scsi.h>
+#include "hw/virtio/virtio-blk.h"
+#include "hw/virtio/virtio-net.h"
+#include "hw/virtio/virtio-serial.h"
+#include "hw/virtio/virtio-scsi.h"
 #ifdef CONFIG_VHOST_SCSI
-#include <hw/virtio/vhost-scsi.h>
+#include "hw/virtio/vhost-scsi.h"
 #endif
-#include <hw/virtio/virtio-balloon.h>
-#include <hw/virtio/virtio-rng.h>
-#include <hw/virtio/virtio-bus.h>
+#include "hw/virtio/virtio-balloon.h"
+#include "hw/virtio/virtio-rng.h"
+#include "hw/virtio/virtio-bus.h"
 
-#include <hw/s390x/s390_flic.h>
-#include <hw/s390x/css.h>
+#include "hw/s390x/s390_flic.h"
+#include "hw/s390x/css.h"
 #include "ccw-device.h"
 #include "hw/s390x/css-bridge.h"
 
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 2a00f2f..5b26946 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -15,8 +15,9 @@
  */
 
 #include "qemu/osdep.h"
-#include "qapi/error.h"
+#include <linux/vhost.h>
 #include <sys/ioctl.h>
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
 #include "monitor/monitor.h"
@@ -27,7 +28,6 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/fw-path-provider.h"
-#include "linux/vhost.h"
 #include "qemu/cutils.h"
 
 /* Features supported by host kernel. */
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index 18ced31..b173b94 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -15,9 +15,9 @@
 #include "hw/virtio/virtio-scsi.h"
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
-#include <hw/scsi/scsi.h>
-#include <block/scsi.h>
-#include <hw/virtio/virtio-bus.h>
+#include "hw/scsi/scsi.h"
+#include "block/scsi.h"
+#include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 
 /* Context: QEMU global mutex held */
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index e8179d6..722c93e 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -20,9 +20,9 @@
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "sysemu/block-backend.h"
-#include <hw/scsi/scsi.h>
-#include <block/scsi.h>
-#include <hw/virtio/virtio-bus.h>
+#include "hw/scsi/scsi.h"
+#include "block/scsi.h"
+#include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 
 static inline int virtio_scsi_get_lun(uint8_t *lun)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index da71c8c..5116f4a 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -28,7 +28,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/scsi/scsi.h"
-#include <block/scsi.h>
+#include "block/scsi.h"
 #include "hw/pci/msi.h"
 #include "vmw_pvscsi.h"
 #include "trace.h"
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 7bed0ce..7992456 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include <libusb.h>
+#include <sys/user.h>
 
 #include "qemu-common.h"
 #include "qemu/config-file.h"
@@ -31,7 +32,6 @@
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qstring.h"
-#include "sys/user.h"
 
 #include <xen/io/ring.h>
 #include <xen/io/usbif.h>
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index f3c0522..b313e7c 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -20,6 +20,9 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
+#ifdef CONFIG_KVM
+#include <linux/kvm.h>
+#endif
 #include <linux/vfio.h>
 
 #include "hw/vfio/vfio-common.h"
@@ -30,9 +33,6 @@
 #include "qemu/error-report.h"
 #include "qemu/range.h"
 #include "sysemu/kvm.h"
-#ifdef CONFIG_KVM
-#include "linux/kvm.h"
-#endif
 #include "trace.h"
 
 struct vfio_group_head vfio_group_list =
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index d62372e..7681f15 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -9,12 +9,11 @@
  */
 
 #include "qemu/osdep.h"
+#include <linux/vhost.h>
+#include <sys/ioctl.h>
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-backend.h"
 #include "qemu/error-report.h"
-#include "linux/vhost.h"
-
-#include <sys/ioctl.h>
 
 static int vhost_kernel_call(struct vhost_dev *dev, unsigned long int request,
                              void *arg)
diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h
index 0d0da3a..be96254 100644
--- a/include/exec/helper-gen.h
+++ b/include/exec/helper-gen.h
@@ -4,7 +4,7 @@
 #ifndef HELPER_GEN_H
 #define HELPER_GEN_H 1
 
-#include <exec/helper-head.h>
+#include "exec/helper-head.h"
 
 #define DEF_HELPER_FLAGS_0(name, flags, ret)                            \
 static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret))        \
diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h
index effdd43..0090137 100644
--- a/include/exec/helper-proto.h
+++ b/include/exec/helper-proto.h
@@ -4,7 +4,7 @@
 #ifndef HELPER_PROTO_H
 #define HELPER_PROTO_H 1
 
-#include <exec/helper-head.h>
+#include "exec/helper-head.h"
 
 #define DEF_HELPER_FLAGS_0(name, flags, ret) \
 dh_ctype(ret) HELPER(name) (void);
diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h
index 79fa3c8..62d87a3 100644
--- a/include/exec/helper-tcg.h
+++ b/include/exec/helper-tcg.h
@@ -4,7 +4,7 @@
 #ifndef HELPER_TCG_H
 #define HELPER_TCG_H 1
 
-#include <exec/helper-head.h>
+#include "exec/helper-head.h"
 
 #define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \
   { .func = HELPER(NAME), .name = #NAME, .flags = FLAGS, \
diff --git a/include/exec/tb-hash-xx.h b/include/exec/tb-hash-xx.h
index 9f3fc05..85b741d 100644
--- a/include/exec/tb-hash-xx.h
+++ b/include/exec/tb-hash-xx.h
@@ -33,7 +33,7 @@
 #ifndef EXEC_TB_HASH_XX
 #define EXEC_TB_HASH_XX
 
-#include <qemu/bitops.h>
+#include "qemu/bitops.h"
 
 #define PRIME32_1   2654435761U
 #define PRIME32_2   2246822519U
diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h
index b15a09f..4573570 100644
--- a/include/hw/gpio/imx_gpio.h
+++ b/include/hw/gpio/imx_gpio.h
@@ -20,7 +20,7 @@
 #ifndef __IMX_GPIO_H_
 #define __IMX_GPIO_H_
 
-#include <hw/sysbus.h>
+#include "hw/sysbus.h"
 
 #define TYPE_IMX_GPIO "imx.gpio"
 #define IMX_GPIO(obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO)
diff --git a/include/hw/i2c/imx_i2c.h b/include/hw/i2c/imx_i2c.h
index e2ee8ea..fb95df5 100644
--- a/include/hw/i2c/imx_i2c.h
+++ b/include/hw/i2c/imx_i2c.h
@@ -21,7 +21,7 @@
 #ifndef __IMX_I2C_H_
 #define __IMX_I2C_H_
 
-#include <hw/sysbus.h>
+#include "hw/sysbus.h"
 
 #define TYPE_IMX_I2C "imx.i2c"
 #define IMX_I2C(obj) OBJECT_CHECK(IMXI2CState, (obj), TYPE_IMX_I2C)
diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
index bc777ed..0ca7c65 100644
--- a/include/hw/ide/ahci.h
+++ b/include/hw/ide/ahci.h
@@ -24,7 +24,7 @@
 #ifndef HW_IDE_AHCI_H
 #define HW_IDE_AHCI_H
 
-#include <hw/sysbus.h>
+#include "hw/sysbus.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
 #define AHCI_MAX_PORTS            32
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 773928a..7824bc3 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -6,8 +6,8 @@
  * only files in hw/ide/ are supposed to include this file.
  * non-internal declarations are in hw/ide.h
  */
-#include <hw/ide.h>
-#include <hw/isa/isa.h>
+#include "hw/ide.h"
+#include "hw/isa/isa.h"
 #include "sysemu/dma.h"
 #include "sysemu/sysemu.h"
 #include "hw/block/block.h"
diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h
index 0f2d4b9..dbc6a03 100644
--- a/include/hw/ide/pci.h
+++ b/include/hw/ide/pci.h
@@ -1,7 +1,7 @@
 #ifndef HW_IDE_PCI_H
 #define HW_IDE_PCI_H
 
-#include <hw/ide/internal.h>
+#include "hw/ide/internal.h"
 
 #define BM_STATUS_DMAING 0x01
 #define BM_STATUS_ERROR  0x02
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 08e8411..6aa506f 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -12,9 +12,9 @@
 #if !defined(__HW_SPAPR_DRC_H__)
 #define __HW_SPAPR_DRC_H__
 
+#include <libfdt.h>
 #include "qom/object.h"
 #include "hw/qdev.h"
-#include "libfdt.h"
 
 #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector"
 #define SPAPR_DR_CONNECTOR_GET_CLASS(obj) \
diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-facility.h
index dd88818..def1bb0 100644
--- a/include/hw/s390x/event-facility.h
+++ b/include/hw/s390x/event-facility.h
@@ -15,7 +15,7 @@
 #ifndef HW_S390_SCLP_EVENT_FACILITY_H
 #define HW_S390_SCLP_EVENT_FACILITY_H
 
-#include <hw/qdev.h>
+#include "hw/qdev.h"
 #include "qemu/thread.h"
 #include "hw/s390x/sclp.h"
 
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index fbf357d..ba28d1d 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -14,8 +14,8 @@
 #ifndef HW_S390_SCLP_H
 #define HW_S390_SCLP_H
 
-#include <hw/sysbus.h>
-#include <hw/qdev.h>
+#include "hw/sysbus.h"
+#include "hw/qdev.h"
 
 #define SCLP_CMD_CODE_MASK                      0xffff00ff
 
diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-keys.h
index 72b850c..5ed7a0e 100644
--- a/include/hw/s390x/storage-keys.h
+++ b/include/hw/s390x/storage-keys.h
@@ -12,7 +12,7 @@
 #ifndef __S390_STORAGE_KEYS_H
 #define __S390_STORAGE_KEYS_H
 
-#include <hw/qdev.h>
+#include "hw/qdev.h"
 #include "monitor/monitor.h"
 
 #define TYPE_S390_SKEYS "s390-skeys"
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 15ea767..8e31b9b 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -27,7 +27,7 @@
 #define QEMU_VMSTATE_H 1
 
 #ifndef CONFIG_USER_ONLY
-#include <migration/qemu-file.h>
+#include "migration/qemu-file.h"
 #endif
 #include "migration/qjson.h"
 
diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h
index 4dfc055..18eb3fd 100644
--- a/include/qemu/seqlock.h
+++ b/include/qemu/seqlock.h
@@ -13,8 +13,8 @@
 #ifndef QEMU_SEQLOCK_H
 #define QEMU_SEQLOCK_H 1
 
-#include <qemu/atomic.h>
-#include <qemu/thread.h>
+#include "qemu/atomic.h"
+#include "qemu/thread.h"
 
 typedef struct QemuSeqLock QemuSeqLock;
 
diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h
index eb5c7a1..24f8490 100644
--- a/include/qemu/thread-posix.h
+++ b/include/qemu/thread-posix.h
@@ -1,6 +1,7 @@
 #ifndef __QEMU_THREAD_POSIX_H
 #define __QEMU_THREAD_POSIX_H 1
-#include "pthread.h"
+
+#include <pthread.h>
 #include <semaphore.h>
 
 struct QemuMutex {
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h
index 385ff5f..1417d38 100644
--- a/include/qemu/thread-win32.h
+++ b/include/qemu/thread-win32.h
@@ -1,6 +1,7 @@
 #ifndef __QEMU_THREAD_WIN32_H
 #define __QEMU_THREAD_WIN32_H 1
-#include "windows.h"
+
+#include <windows.h>
 
 struct QemuMutex {
     CRITICAL_SECTION lock;
diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h
index 0b07284..7f6f654 100644
--- a/linux-user/arm/nwfpe/fpa11.h
+++ b/linux-user/arm/nwfpe/fpa11.h
@@ -21,8 +21,7 @@
 #ifndef __FPA11_H__
 #define __FPA11_H__
 
-
-#include <cpu.h>
+#include "cpu.h"
 
 #define GET_FPA11() (qemufpa)
 
diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index 48ad1c5..42d1079 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -37,7 +37,7 @@
 
 #include "qemu.h"
 #include "flat.h"
-#include <target_flat.h>
+#include "target_flat.h"
 
 //#define DEBUG
 
diff --git a/monitor.c b/monitor.c
index ed09cdc..d6335d3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -58,7 +58,7 @@
 #include "qapi/qmp/qjson.h"
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/json-parser.h"
-#include <qom/object_interfaces.h>
+#include "qom/object_interfaces.h"
 #include "cpu.h"
 #include "trace.h"
 #include "trace/control.h"
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index cd9cdb4..f4160a3 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -13,8 +13,7 @@
 #include "qemu/osdep.h"
 
 #include "vss-common.h"
-#include "inc/win2003/vscoordint.h"
-
+#include <inc/win2003/vscoordint.h>
 #include <comadmin.h>
 #include <wbemidl.h>
 #include <comdef.h>
diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index d977393..ef94669 100644
--- a/qga/vss-win32/provider.cpp
+++ b/qga/vss-win32/provider.cpp
@@ -12,8 +12,8 @@
 
 #include "qemu/osdep.h"
 #include "vss-common.h"
-#include "inc/win2003/vscoordint.h"
-#include "inc/win2003/vsprov.h"
+#include <inc/win2003/vscoordint.h>
+#include <inc/win2003/vsprov.h>
 
 #define VSS_TIMEOUT_MSEC (60*1000)
 
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 889052d..0cd2f0e 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -13,8 +13,8 @@
 #include "qemu/osdep.h"
 #include "vss-common.h"
 #include "requester.h"
-#include "inc/win2003/vswriter.h"
-#include "inc/win2003/vsbackup.h"
+#include <inc/win2003/vswriter.h>
+#include <inc/win2003/vsbackup.h>
 
 /* Max wait time for frozen event (VSS can only hold writes for 10 seconds) */
 #define VSS_TIMEOUT_FREEZE_MSEC 10000
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index 91dae0c..1ffde0f 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -50,7 +50,7 @@
  * VSS headers must be installed from Microsoft VSS SDK 7.2 available at:
  * http://www.microsoft.com/en-us/download/details.aspx?id=23490
  */
-#include "inc/win2003/vss.h"
+#include <inc/win2003/vss.h>
 
 /* Macros to convert char definitions to wchar */
 #define _L(a) L##a
diff --git a/slirp/bootp.c b/slirp/bootp.c
index 7b3232b..5a4646c 100644
--- a/slirp/bootp.c
+++ b/slirp/bootp.c
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 #if defined(_WIN32)
 /* Windows ntohl() returns an u_long value.
diff --git a/slirp/cksum.c b/slirp/cksum.c
index 2ad0e65..6d73abf 100644
--- a/slirp/cksum.c
+++ b/slirp/cksum.c
@@ -31,7 +31,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 /*
  * Checksum routine for Internet Protocol family headers (Portable Version).
diff --git a/slirp/if.c b/slirp/if.c
index 9b02180..51ae0d0 100644
--- a/slirp/if.c
+++ b/slirp/if.c
@@ -6,7 +6,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "qemu/timer.h"
 
 static void
diff --git a/slirp/ip_input.c b/slirp/ip_input.c
index 34fba2b..348e1dc 100644
--- a/slirp/ip_input.c
+++ b/slirp/ip_input.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "ip_icmp.h"
 
 static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp);
diff --git a/slirp/ip_output.c b/slirp/ip_output.c
index 0d6b3b8..db403f0 100644
--- a/slirp/ip_output.c
+++ b/slirp/ip_output.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 /* Number of packets queued before we start sending
  * (to prevent allocing too many mbufs) */
diff --git a/slirp/mbuf.c b/slirp/mbuf.c
index d136988..7eddc21 100644
--- a/slirp/mbuf.c
+++ b/slirp/mbuf.c
@@ -16,7 +16,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 #define MBUF_THRESH 30
 
diff --git a/slirp/misc.c b/slirp/misc.c
index 1a0ea1b..88e9d94 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -6,9 +6,8 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
-#include <libslirp.h>
-
+#include "slirp.h"
+#include "libslirp.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
diff --git a/slirp/sbuf.c b/slirp/sbuf.c
index dd4cb8c..10119d3 100644
--- a/slirp/sbuf.c
+++ b/slirp/sbuf.c
@@ -6,8 +6,8 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
-#include <qemu/main-loop.h>
+#include "slirp.h"
+#include "qemu/main-loop.h"
 
 static void sbappendsb(struct sbuf *sb, struct mbuf *m);
 
diff --git a/slirp/socket.c b/slirp/socket.c
index 02e89ce..280050a 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -7,7 +7,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "ip_icmp.h"
 #ifdef __sun__
 #include <sys/filio.h>
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index e2b5d4e..c5063a9 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "ip_icmp.h"
 
 #define	TCPREXMTTHRESH 3
diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c
index 99b0a9b..819db27 100644
--- a/slirp/tcp_output.c
+++ b/slirp/tcp_output.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 static const u_char  tcp_outflags[TCP_NSTATES] = {
 	TH_RST|TH_ACK, 0,      TH_SYN,        TH_SYN|TH_ACK,
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 6b9fef2..ed16e18 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 /* patchable/settable parameters for tcp */
 /* Don't do rfc1323 performance enhancements */
diff --git a/slirp/tcp_timer.c b/slirp/tcp_timer.c
index 8f5dd77..f9060c7 100644
--- a/slirp/tcp_timer.c
+++ b/slirp/tcp_timer.c
@@ -31,7 +31,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 
 static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer);
 
diff --git a/slirp/tftp.c b/slirp/tftp.c
index 3673402..c185906 100644
--- a/slirp/tftp.c
+++ b/slirp/tftp.c
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "qemu-common.h"
 #include "qemu/cutils.h"
 
diff --git a/slirp/udp.c b/slirp/udp.c
index 247024f..93d7224 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -39,7 +39,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <slirp.h>
+#include "slirp.h"
 #include "ip_icmp.h"
 
 static uint8_t udp_tos(struct socket *so);
diff --git a/target-arm/arm-powerctl.c b/target-arm/arm-powerctl.c
index d452230..6519d52 100644
--- a/target-arm/arm-powerctl.c
+++ b/target-arm/arm-powerctl.c
@@ -9,8 +9,8 @@
  */
 
 #include "qemu/osdep.h"
-#include <cpu.h>
-#include <cpu-qom.h>
+#include "cpu.h"
+#include "cpu-qom.h"
 #include "internals.h"
 #include "arm-powerctl.h"
 #include "qemu/log.h"
diff --git a/target-arm/psci.c b/target-arm/psci.c
index 4db9b8c..14316eb 100644
--- a/target-arm/psci.c
+++ b/target-arm/psci.c
@@ -16,10 +16,10 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include <cpu.h>
-#include <exec/helper-proto.h>
-#include <kvm-consts.h>
-#include <sysemu/sysemu.h>
+#include "cpu.h"
+#include "exec/helper-proto.h"
+#include "kvm-consts.h"
+#include "sysemu/sysemu.h"
 #include "internals.h"
 #include "arm-powerctl.h"
 #include "exec/exec-all.h"
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 8f257fb..7cb7842 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -21,7 +21,7 @@
 #include "qemu/osdep.h"
 #include "disas/bfd.h"
 #include "exec/gdbstub.h"
-#include <sysemu/kvm.h>
+#include "sysemu/kvm.h"
 #include "kvm_ppc.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/cpus.h"
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 8bcb0f7..0c8dba3 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -219,7 +219,7 @@ int s390_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 void s390_cpu_gdb_init(CPUState *cs);
 void s390x_cpu_debug_excp_handler(CPUState *cs);
 
-#include <sysemu/kvm.h>
+#include "sysemu/kvm.h"
 
 /* distinguish between 24 bit and 31 bit addressing */
 #define HIGH_ORDER_BIT 0x80000000
diff --git a/target-unicore32/softmmu.c b/target-unicore32/softmmu.c
index a34026a..e7152e7 100644
--- a/target-unicore32/softmmu.c
+++ b/target-unicore32/softmmu.c
@@ -13,7 +13,7 @@
 #endif
 
 #include "qemu/osdep.h"
-#include <cpu.h>
+#include "cpu.h"
 #include "exec/exec-all.h"
 
 #undef DEBUG_UC32
diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c
index 35d5180..16465ab 100644
--- a/tests/postcopy-test.c
+++ b/tests/postcopy-test.c
@@ -15,11 +15,10 @@
 #include "libqtest.h"
 #include "qemu/option.h"
 #include "qemu/range.h"
+#include "qemu/sockets.h"
 #include "sysemu/char.h"
 #include "sysemu/sysemu.h"
 
-#include <qemu/sockets.h>
-
 const unsigned start_address = 1024 * 1024;
 const unsigned end_address = 100 * 1024 * 1024;
 bool got_stop;
diff --git a/tests/tcg/xtensa/linker.ld.S b/tests/tcg/xtensa/linker.ld.S
index f1e7fa9..5902302 100644
--- a/tests/tcg/xtensa/linker.ld.S
+++ b/tests/tcg/xtensa/linker.ld.S
@@ -1,4 +1,4 @@
-#include <core-isa.h>
+#include "core-isa.h"
 
 #if XTENSA_HAVE_BE
 OUTPUT_FORMAT("elf32-xtensa-be")
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 45fa2b6..775e031 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -36,8 +36,6 @@
 #include <sys/eventfd.h>
 #include <arpa/inet.h>
 #include <netdb.h>
-#include <qemu/osdep.h>
-
 #include <linux/vhost.h>
 
 #include "qemu/atomic.h"
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 421d432..46d0588 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -13,12 +13,12 @@
 #include "libqtest.h"
 #include "qemu/option.h"
 #include "qemu/range.h"
+#include "qemu/sockets.h"
 #include "sysemu/char.h"
 #include "sysemu/sysemu.h"
 
 #include <linux/vhost.h>
 #include <sys/vfs.h>
-#include <qemu/sockets.h>
 
 /* GLIB version compatibility flags */
 #if !GLIB_CHECK_VERSION(2, 26, 0)
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 629d97a..5a85aa3 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -9,8 +9,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or
  * later.  See the COPYING file in the top-level directory.
  */
+
 #include "qemu/osdep.h"
-#include <qemu/mmap-alloc.h>
+#include "qemu/mmap-alloc.h"
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index e2e1d4d..d8e5dcf 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -48,7 +48,7 @@
 #include <sys/sysctl.h>
 #endif
 
-#include <qemu/mmap-alloc.h>
+#include "qemu/mmap-alloc.h"
 
 int qemu_get_thread_id(void)
 {
-- 
2.5.5

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

* [Qemu-devel] [PULL 02/18] scripts: New clean-header-guards.pl
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 01/18] Use #include "..." for our own headers, <...> for others Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 03/18] target-*: Clean up cpu.h header guards Markus Armbruster
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

The conventional way to ensure a header can be included multiple times
is to bracket it like this:

    #ifndef HEADER_NAME_H
    #define HEADER_NAME_H
    ...
    #endif

where HEADER_NAME_H is a symbol unique to this header.

The endif may be optionally decorated like this:

    #endif /* HEADER_NAME_H */

Unconventional ways present in our code:

* Identifiers reserved for any use:
    #define _FILEOP_H

* Lowercase (bad idea for object-like macros):
    #define __linux_video_vga_h__

* Roundabout ways to say the same thing (and hide from grep):
    #if !defined(__PPC_MAC_H__)
    #endif /* !defined(__PPC_MAC_H__) */

* Redundant values:
    #define HW_ALPHA_H 1

* Funny redundant values:
    # define PXA_H                 "pxa.h"

* Decorations with bangs:

    #endif /* !QEMU_ARM_GIC_INTERNAL_H */

  The negation actually makes sense, but almost all our header guard
  #endif decorations don't negate.

* Useless decorations:

   #endif  /* audio.h */

Header guards are not the place to show off creativity.  This script
normalizes them to the conventional way, and cleans up whitespace
while there.  It warns when it renames guard symbols, and explains how
to find occurences of these symbols that may have to be updated
manually.

Another issue is use of the same guard symbol in multiple headers.
That's okay only for headers that cannot be used together, such as the
*-user/*/target_syscall.h.  This script can't tell, so it warns when
it sees a reuse.

The script also warns when preprocessing a header with its guard
symbol defined produces anything but whitespace.

The next commits will put the script to use.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 scripts/clean-header-guards.pl | 213 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 213 insertions(+)
 create mode 100755 scripts/clean-header-guards.pl

diff --git a/scripts/clean-header-guards.pl b/scripts/clean-header-guards.pl
new file mode 100755
index 0000000..54ab99a
--- /dev/null
+++ b/scripts/clean-header-guards.pl
@@ -0,0 +1,213 @@
+#!/usr/bin/perl -w
+#
+# Clean up include guards in headers
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# Authors:
+#  Markus Armbruster <armbru@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# (at your option) any later version. See the COPYING file in the
+# top-level directory.
+#
+# Usage: scripts/clean-header-guards.pl [OPTION]... [FILE]...
+#     -c CC     Use a compiler other than cc
+#     -n        Suppress actual cleanup
+#     -v        Show which files are cleaned up, and which are skipped
+#
+# Does the following:
+# - Header files without a recognizable header guard are skipped.
+# - Clean up any untidy header guards in-place.  Warn if the cleanup
+#   renames guard symbols, and explain how to find occurences of these
+#   symbols that may have to be updated manually.
+# - Warn about duplicate header guard symbols.  To make full use of
+#   this warning, you should clean up *all* headers in one run.
+# - Warn when preprocessing a header with its guard symbol defined
+#   produces anything but whitespace.  The preprocessor is run like
+#   "cc -E -DGUARD_H -c -P -", and fed the test program on stdin.
+
+use strict;
+use Getopt::Std;
+
+# Stuff we don't want to clean because we import it into our tree:
+my $exclude = qr,^(disas/libvixl/|include/standard-headers/
+    |linux-headers/|pc-bios/|tests/tcg/|tests/multiboot/),x;
+# Stuff that is expected to fail the preprocessing test:
+my $exclude_cpp = qr,^include/libdecnumber/decNumberLocal.h,;
+
+my %guarded = ();
+my %old_guard = ();
+
+our $opt_c = "cc";
+our $opt_n = 0;
+our $opt_v = 0;
+getopts("c:nv");
+
+sub skipping {
+    my ($fname, $msg, $line1, $line2) = @_;
+
+    return if !$opt_v or $fname =~ $exclude;
+    print "$fname skipped: $msg\n";
+    print "    $line1" if defined $line1;
+    print "    $line2" if defined $line2;
+}
+
+sub gripe {
+    my ($fname, $msg) = @_;
+    return if $fname =~ $exclude;
+    print STDERR "$fname: warning: $msg\n";
+}
+
+sub slurp {
+    my ($fname) = @_;
+    local $/;                   # slurp
+    open(my $in, "<", $fname)
+        or die "can't open $fname for reading: $!";
+    return <$in>;
+}
+
+sub unslurp {
+    my ($fname, $contents) = @_;
+    open (my $out, ">", $fname)
+        or die "can't open $fname for writing: $!";
+    print $out $contents
+        or die "error writing $fname: $!";
+    close $out
+        or die "error writing $fname: $!";
+}
+
+sub fname2guard {
+    my ($fname) = @_;
+    $fname =~ tr/a-z/A-Z/;
+    $fname =~ tr/A-Z0-9/_/cs;
+    return $fname;
+}
+
+sub preprocess {
+    my ($fname, $guard) = @_;
+
+    open(my $pipe, "-|", "$opt_c -E -D$guard -c -P - <$fname")
+        or die "can't run $opt_c: $!";
+    while (<$pipe>) {
+        if ($_ =~ /\S/) {
+            gripe($fname, "not blank after preprocessing");
+            last;
+        }
+    }
+    close $pipe
+        or gripe($fname, "preprocessing failed ($opt_c exit status $?)");
+}
+
+for my $fname (@ARGV) {
+    my $text = slurp($fname);
+
+    $text =~ m,\A(\s*\n|\s*//\N*\n|\s*/\*.*?\*/\s*\n)*|,msg;
+    my $pre = $&;
+    unless ($text =~ /\G(.*\n)/g) {
+        $text =~ /\G.*/;
+        skipping($fname, "no recognizable header guard", "$&\n");
+        next;
+    }
+    my $line1 = $1;
+    unless ($text =~ /\G(.*\n)/g) {
+        $text =~ /\G.*/;
+        skipping($fname, "no recognizable header guard", "$&\n");
+        next;
+    }
+    my $line2 = $1;
+    my $body = substr($text, pos($text));
+
+    unless ($line1 =~ /^\s*\#\s*(if\s*\!\s*defined(\s*\()?|ifndef)\s*
+                       ([A-Za-z0-9_]+)/x) {
+        skipping($fname, "no recognizable header guard", $line1, $line2);
+        next;
+    }
+    my $guard = $3;
+    unless ($line2 =~ /^\s*\#\s*define\s+([A-Za-z0-9_]+)/) {
+        skipping($fname, "no recognizable header guard", $line1, $line2);
+        next;
+    }
+    my $guard2 = $1;
+    unless ($guard2 eq $guard) {
+        skipping($fname, "mismatched header guard ($guard vs. $guard2) ",
+                 $line1, $line2);
+        next;
+    }
+
+    unless ($body =~ m,\A((.*\n)*)
+                       (\s*\#\s*endif\s*(/\*\s*.*\s*\*/\s*)?\n?)
+                       (\n|\s)*\Z,x) {
+        skipping($fname, "can't find end of header guard");
+        next;
+    }
+    $body = $1;
+    my $line3 = $3;
+    my $endif_comment = $4;
+
+    my $oldg = $guard;
+
+    unless ($fname =~ $exclude) {
+        my @issues = ();
+        $guard =~ tr/a-z/A-Z/
+            and push @issues, "contains lowercase letters";
+        $guard =~ s/^_+//
+            and push @issues, "is a reserved identifier";
+        $guard =~ s/(_H)?_*$/_H/
+            and $& ne "_H" and push @issues, "doesn't end with _H";
+        unless ($guard =~ /^[A-Z][A-Z0-9_]*_H/) {
+            skipping($fname, "can't clean up odd guard symbol $oldg\n",
+                     $line1, $line2);
+            next;
+        }
+
+        my $exp = fname2guard($fname =~ s,.*/,,r);
+        unless ($guard =~ /\Q$exp\E\Z/) {
+            $guard = fname2guard($fname =~ s,^include/,,r);
+            push @issues, "doesn't match the file name";
+        }
+        if (@issues and $opt_v) {
+            print "$fname guard $oldg needs cleanup:\n    ",
+                join(", ", @issues), "\n";
+        }
+    }
+
+    $old_guard{$guard} = $oldg
+        if $guard ne $oldg;
+
+    if (exists $guarded{$guard}) {
+        gripe($fname, "guard $guard also used by $guarded{$guard}");
+    } else {
+        $guarded{$guard} = $fname;
+    }
+
+    unless ($fname =~ $exclude) {
+        my $newl1 = "#ifndef $guard\n";
+        my $newl2 = "#define $guard\n";
+        my $newl3 = "#endif\n";
+        $newl3 =~ s,\Z, /* $guard */, if defined $endif_comment;
+        if ($line1 ne $newl1 or $line2 ne $newl2 or $line3 ne $newl3) {
+            $pre =~ s/\n*\Z/\n\n/ if $pre =~ /\N/;
+            $body =~ s/\A\n*/\n/;
+            if ($opt_n) {
+                print "$fname would be cleaned up\n" if $opt_v;
+            } else {
+                unslurp($fname, "$pre$newl1$newl2$body$newl3");
+                print "$fname cleaned up\n" if $opt_v;
+            }
+        }
+    }
+
+    preprocess($fname, $opt_n ? $oldg : $guard)
+        unless $fname =~ $exclude or $fname =~ $exclude_cpp;
+}
+
+if (%old_guard) {
+    print STDERR "warning: guard symbol renaming may break things\n";
+    for my $guard (sort keys %old_guard) {
+        print STDERR "    $old_guard{$guard} -> $guard\n";
+    }
+    print STDERR "To find uses that may have to be updated try:\n";
+    print STDERR "    git grep -Ew '", join("|", sort values %old_guard),
+        "'\n";
+}
-- 
2.5.5

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

* [Qemu-devel] [PULL 03/18] target-*: Clean up cpu.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 01/18] Use #include "..." for our own headers, <...> for others Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 02/18] scripts: New clean-header-guards.pl Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 04/18] linux-user: Clean up target_syscall.h " Markus Armbruster
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Most of them use guard symbols like CPU_$target_H, but we also have
__MIPS_CPU_H__ and __TRICORE_CPU_H__.  They all upset
scripts/clean-header-guards.pl.

The script dislikes CPU_$target_H because they don't match their file
name (they should, to make guard collisions less likely).  The others
are reserved identifiers.

Clean them all up: use guard symbol $target_CPU_H for
target-$target/cpu.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 target-alpha/cpu.h      | 6 +++---
 target-arm/cpu.h        | 4 ++--
 target-cris/cpu.h       | 5 +++--
 target-i386/cpu.h       | 7 ++++---
 target-lm32/cpu.h       | 4 ++--
 target-m68k/cpu.h       | 5 +++--
 target-microblaze/cpu.h | 5 +++--
 target-mips/cpu.h       | 6 +++---
 target-moxie/cpu.h      | 7 ++++---
 target-openrisc/cpu.h   | 6 +++---
 target-ppc/cpu.h        | 7 ++++---
 target-s390x/cpu.h      | 5 +++--
 target-sh4/cpu.h        | 7 ++++---
 target-sparc/cpu.h      | 4 ++--
 target-tilegx/cpu.h     | 5 +++--
 target-tricore/cpu.h    | 7 ++++---
 target-unicore32/cpu.h  | 7 ++++---
 target-xtensa/cpu.h     | 4 ++--
 18 files changed, 56 insertions(+), 45 deletions(-)

diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 791da3b..ac5e801 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#if !defined (__CPU_ALPHA_H__)
-#define __CPU_ALPHA_H__
+#ifndef ALPHA_CPU_H
+#define ALPHA_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
@@ -524,4 +524,4 @@ static inline void cpu_get_tb_cpu_state(CPUAlphaState *env, target_ulong *pc,
     *pflags = flags;
 }
 
-#endif /* !defined (__CPU_ALPHA_H__) */
+#endif /* ALPHA_CPU_H */
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index e2fac46..76d824d 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -16,9 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_ARM_H
-#define CPU_ARM_H
 
+#ifndef ARM_CPU_H
+#define ARM_CPU_H
 
 #include "kvm-consts.h"
 
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index e6046d2..7d7fe6e 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -17,8 +17,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_CRIS_H
-#define CPU_CRIS_H
+
+#ifndef CRIS_CPU_H
+#define CRIS_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 5c7a279..776efe6 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_I386_H
-#define CPU_I386_H
+
+#ifndef I386_CPU_H
+#define I386_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
@@ -1607,4 +1608,4 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
 /* cpu.c */
 bool cpu_is_bsp(X86CPU *cpu);
 
-#endif /* CPU_I386_H */
+#endif /* I386_CPU_H */
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h
index 4efe98d..d8a3515 100644
--- a/target-lm32/cpu.h
+++ b/target-lm32/cpu.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef CPU_LM32_H
-#define CPU_LM32_H
+#ifndef LM32_CPU_H
+#define LM32_CPU_H
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 9087769..b2faa6b 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -17,8 +17,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_M68K_H
-#define CPU_M68K_H
+
+#ifndef M68K_CPU_H
+#define M68K_CPU_H
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 16815df..beb75ff 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_MICROBLAZE_H
-#define CPU_MICROBLAZE_H
+
+#ifndef MICROBLAZE_CPU_H
+#define MICROBLAZE_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 9c4fc81..5182dc7 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -1,5 +1,5 @@
-#if !defined (__MIPS_CPU_H__)
-#define __MIPS_CPU_H__
+#ifndef MIPS_CPU_H
+#define MIPS_CPU_H
 
 //#define DEBUG_OP
 
@@ -1066,4 +1066,4 @@ static inline void QEMU_NORETURN do_raise_exception(CPUMIPSState *env,
     do_raise_exception_err(env, exception, 0, pc);
 }
 
-#endif /* !defined (__MIPS_CPU_H__) */
+#endif /* MIPS_CPU_H */
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index 63d5caf..3e880fa 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef _CPU_MOXIE_H
-#define _CPU_MOXIE_H
+
+#ifndef MOXIE_CPU_H
+#define MOXIE_CPU_H
 
 #include "qemu-common.h"
 
@@ -139,4 +140,4 @@ static inline void cpu_get_tb_cpu_state(CPUMoxieState *env, target_ulong *pc,
 int moxie_cpu_handle_mmu_fault(CPUState *cpu, vaddr address,
                                int rw, int mmu_idx);
 
-#endif /* _CPU_MOXIE_H */
+#endif /* MOXIE_CPU_H */
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index 9451a7c..aaf1535 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef CPU_OPENRISC_H
-#define CPU_OPENRISC_H
+#ifndef OPENRISC_CPU_H
+#define OPENRISC_CPU_H
 
 #define TARGET_LONG_BITS 32
 
@@ -408,4 +408,4 @@ static inline int cpu_mmu_index(CPUOpenRISCState *env, bool ifetch)
 
 #define CPU_INTERRUPT_TIMER   CPU_INTERRUPT_TGT_INT_0
 
-#endif /* CPU_OPENRISC_H */
+#endif /* OPENRISC_CPU_H */
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 2666a3f..5fce1ff 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#if !defined (__CPU_PPC_H__)
-#define __CPU_PPC_H__
+
+#ifndef PPC_CPU_H
+#define PPC_CPU_H
 
 #include "qemu-common.h"
 
@@ -2432,4 +2433,4 @@ int ppc_get_vcpu_dt_id(PowerPCCPU *cpu);
 PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id);
 
 void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len);
-#endif /* !defined (__CPU_PPC_H__) */
+#endif /* PPC_CPU_H */
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 0c8dba3..c216bda 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -19,8 +19,9 @@
  * You should have received a copy of the GNU (Lesser) General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_S390X_H
-#define CPU_S390X_H
+
+#ifndef S390X_CPU_H
+#define S390X_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index 3f9dae2..478ab55 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef _CPU_SH4_H
-#define _CPU_SH4_H
+
+#ifndef SH4_CPU_H
+#define SH4_CPU_H
 
 #include "qemu-common.h"
 #include "cpu-qom.h"
@@ -387,4 +388,4 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *env, target_ulong *pc,
             | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 4 */
 }
 
-#endif				/* _CPU_SH4_H */
+#endif /* SH4_CPU_H */
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 604de84..15364a0 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -1,5 +1,5 @@
-#ifndef CPU_SPARC_H
-#define CPU_SPARC_H
+#ifndef SPARC_CPU_H
+#define SPARC_CPU_H
 
 #include "qemu-common.h"
 #include "qemu/bswap.h"
diff --git a/target-tilegx/cpu.h b/target-tilegx/cpu.h
index d740329..1735427 100644
--- a/target-tilegx/cpu.h
+++ b/target-tilegx/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef CPU_TILEGX_H
-#define CPU_TILEGX_H
+
+#ifndef TILEGX_CPU_H
+#define TILEGX_CPU_H
 
 #include "qemu-common.h"
 
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index a298d63..a3493a1 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -16,8 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#if !defined(__TRICORE_CPU_H__)
-#define __TRICORE_CPU_H__
+
+#ifndef TRICORE_CPU_H
+#define TRICORE_CPU_H
 
 #include "tricore-defs.h"
 #include "qemu-common.h"
@@ -420,4 +421,4 @@ int cpu_tricore_handle_mmu_fault(CPUState *cpu, target_ulong address,
                                  int rw, int mmu_idx);
 #define cpu_handle_mmu_fault cpu_tricore_handle_mmu_fault
 
-#endif /*__TRICORE_CPU_H__ */
+#endif /* TRICORE_CPU_H */
diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 83f7584..7b5b405 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -8,8 +8,9 @@
  * published by the Free Software Foundation, or (at your option) any
  * later version. See the COPYING file in the top-level directory.
  */
-#ifndef QEMU_UNICORE32_CPU_H
-#define QEMU_UNICORE32_CPU_H
+
+#ifndef UNICORE32_CPU_H
+#define UNICORE32_CPU_H
 
 #define TARGET_LONG_BITS                32
 #define TARGET_PAGE_BITS                12
@@ -184,4 +185,4 @@ int uc32_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
 void uc32_translate_init(void);
 void switch_mode(CPUUniCore32State *, int);
 
-#endif /* QEMU_UNICORE32_CPU_H */
+#endif /* UNICORE32_CPU_H */
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index ce9fb5b..7fe82a3 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -25,8 +25,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef CPU_XTENSA_H
-#define CPU_XTENSA_H
+#ifndef XTENSA_CPU_H
+#define XTENSA_CPU_H
 
 #define ALIGNED_ONLY
 #define TARGET_LONG_BITS 32
-- 
2.5.5

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

* [Qemu-devel] [PULL 04/18] linux-user: Clean up target_syscall.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (2 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 03/18] target-*: Clean up cpu.h header guards Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 05/18] linux-user: Clean up target_cpu.h " Markus Armbruster
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Some of them use guard symbol TARGET_SYSCALL_H, but we also have
CRIS_SYSCALL_H, MICROBLAZE_SYSCALLS_H, TILEGX_SYSCALLS_H and
__UC32_SYSCALL_H__.  They all upset scripts/clean-header-guards.pl.

Reuse of the same guard symbol TARGET_SYSCALL_H in multiple headers is
okay as long as they cannot be included together.  The script can't
tell, so it warns.

The script dislikes the other guard symbols, too.  They don't match
their file name (they should, to make guard collisions less likely),
and __UC32_SYSCALL_H__ is a reserved identifier.

Clean them all up: use guard symbol $target_TARGET_SYSCALL_H for
linux-user/$target/target_sycall.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/aarch64/target_syscall.h    | 6 +++---
 linux-user/alpha/target_syscall.h      | 6 +++---
 linux-user/arm/target_syscall.h        | 6 +++---
 linux-user/cris/target_syscall.h       | 4 ++--
 linux-user/i386/target_syscall.h       | 6 +++---
 linux-user/m68k/target_syscall.h       | 6 +++---
 linux-user/microblaze/target_syscall.h | 4 ++--
 linux-user/mips/target_syscall.h       | 6 +++---
 linux-user/mips64/target_syscall.h     | 6 +++---
 linux-user/openrisc/target_syscall.h   | 6 +++---
 linux-user/ppc/target_syscall.h        | 6 +++---
 linux-user/s390x/target_syscall.h      | 6 +++---
 linux-user/sh4/target_syscall.h        | 6 +++---
 linux-user/sparc/target_syscall.h      | 6 +++---
 linux-user/sparc64/target_syscall.h    | 6 +++---
 linux-user/tilegx/target_syscall.h     | 4 ++--
 linux-user/unicore32/target_syscall.h  | 8 +++++---
 linux-user/x86_64/target_syscall.h     | 6 +++---
 18 files changed, 53 insertions(+), 51 deletions(-)

diff --git a/linux-user/aarch64/target_syscall.h b/linux-user/aarch64/target_syscall.h
index f458018..1b62953 100644
--- a/linux-user/aarch64/target_syscall.h
+++ b/linux-user/aarch64/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef AARCH64_TARGET_SYSCALL_H
+#define AARCH64_TARGET_SYSCALL_H
 
 struct target_pt_regs {
     uint64_t        regs[31];
@@ -15,4 +15,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* AARCH64_TARGET_SYSCALL_H */
diff --git a/linux-user/alpha/target_syscall.h b/linux-user/alpha/target_syscall.h
index 3db4b16..b580fc5 100644
--- a/linux-user/alpha/target_syscall.h
+++ b/linux-user/alpha/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef ALPHA_TARGET_SYSCALL_H
+#define ALPHA_TARGET_SYSCALL_H
 
 /* default linux values for the selectors */
 #define __USER_DS	(1)
@@ -259,4 +259,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT     0x2000
 #define TARGET_MLOCKALL_MCL_FUTURE      0x4000
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* ALPHA_TARGET_SYSCALL_H */
diff --git a/linux-user/arm/target_syscall.h b/linux-user/arm/target_syscall.h
index 11077b7..cd021ff 100644
--- a/linux-user/arm/target_syscall.h
+++ b/linux-user/arm/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef ARM_TARGET_SYSCALL_H
+#define ARM_TARGET_SYSCALL_H
 
 /* this struct defines the way the registers are stored on the
    stack during a system call. */
@@ -33,4 +33,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* ARM_TARGET_SYSCALL_H */
diff --git a/linux-user/cris/target_syscall.h b/linux-user/cris/target_syscall.h
index 2957b0d..29d6900 100644
--- a/linux-user/cris/target_syscall.h
+++ b/linux-user/cris/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef CRIS_SYSCALL_H
-#define CRIS_SYSCALL_H 1
+#ifndef CRIS_TARGET_SYSCALL_H
+#define CRIS_TARGET_SYSCALL_H
 
 #define UNAME_MACHINE "cris"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/i386/target_syscall.h b/linux-user/i386/target_syscall.h
index 0ac84dc..b4e895f 100644
--- a/linux-user/i386/target_syscall.h
+++ b/linux-user/i386/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef I386_TARGET_SYSCALL_H
+#define I386_TARGET_SYSCALL_H
 
 /* default linux values for the selectors */
 #define __USER_CS	(0x23)
@@ -154,4 +154,4 @@ struct target_vm86plus_struct {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* I386_TARGET_SYSCALL_H */
diff --git a/linux-user/m68k/target_syscall.h b/linux-user/m68k/target_syscall.h
index 97a4cc0..db2be4f 100644
--- a/linux-user/m68k/target_syscall.h
+++ b/linux-user/m68k/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef M68K_TARGET_SYSCALL_H
+#define M68K_TARGET_SYSCALL_H
 
 /* this struct defines the way the registers are stored on the
    stack during a system call. */
@@ -26,4 +26,4 @@ struct target_pt_regs {
 
 void do_m68k_simcall(CPUM68KState *, int);
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* M68K_TARGET_SYSCALL_H */
diff --git a/linux-user/microblaze/target_syscall.h b/linux-user/microblaze/target_syscall.h
index 3c1ed27..0b6980c 100644
--- a/linux-user/microblaze/target_syscall.h
+++ b/linux-user/microblaze/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef MICROBLAZE_SYSCALLS_H
-#define MICROBLAZE_SYSCALLS_H 1
+#ifndef MICROBLAZE_TARGET_SYSCALL_H
+#define MICROBLAZE_TARGET_SYSCALL_H
 
 #define UNAME_MACHINE "microblaze"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/mips/target_syscall.h b/linux-user/mips/target_syscall.h
index e8e305c..2b4f390 100644
--- a/linux-user/mips/target_syscall.h
+++ b/linux-user/mips/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef MIPS_TARGET_SYSCALL_H
+#define MIPS_TARGET_SYSCALL_H
 
 /* this struct defines the way the registers are stored on the
    stack during a system call. */
@@ -230,4 +230,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* MIPS_TARGET_SYSCALL_H */
diff --git a/linux-user/mips64/target_syscall.h b/linux-user/mips64/target_syscall.h
index 5789e86..8da9c1f 100644
--- a/linux-user/mips64/target_syscall.h
+++ b/linux-user/mips64/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef MIPS64_TARGET_SYSCALL_H
+#define MIPS64_TARGET_SYSCALL_H
 
 /* this struct defines the way the registers are stored on the
    stack during a system call. */
@@ -227,4 +227,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* MIPS64_TARGET_SYSCALL_H */
diff --git a/linux-user/openrisc/target_syscall.h b/linux-user/openrisc/target_syscall.h
index 19aeffc..9d3380f 100644
--- a/linux-user/openrisc/target_syscall.h
+++ b/linux-user/openrisc/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef OPENRISC_TARGET_SYSCALL_H
+#define OPENRISC_TARGET_SYSCALL_H
 
 struct target_pt_regs {
     union {
@@ -31,4 +31,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* OPENRISC_TARGET_SYSCALL_H */
diff --git a/linux-user/ppc/target_syscall.h b/linux-user/ppc/target_syscall.h
index 7ca83c2..a8662f4 100644
--- a/linux-user/ppc/target_syscall.h
+++ b/linux-user/ppc/target_syscall.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef PPC_TARGET_SYSCALL_H
+#define PPC_TARGET_SYSCALL_H
 
 /* XXX: ABSOLUTELY BUGGY:
  * for now, this is quite just a cut-and-paste from i386 target...
@@ -75,4 +75,4 @@ struct target_revectored_struct {
 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000
 #define TARGET_MLOCKALL_MCL_FUTURE  0x4000
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* PPC_TARGET_SYSCALL_H */
diff --git a/linux-user/s390x/target_syscall.h b/linux-user/s390x/target_syscall.h
index 02061ef..8d4f609 100644
--- a/linux-user/s390x/target_syscall.h
+++ b/linux-user/s390x/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef S390X_TARGET_SYSCALL_H
+#define S390X_TARGET_SYSCALL_H
 
 /* this typedef defines how a Program Status Word looks like */
 typedef struct {
@@ -31,4 +31,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* S390X_TARGET_SYSCALL_H */
diff --git a/linux-user/sh4/target_syscall.h b/linux-user/sh4/target_syscall.h
index 9f3381b..78d5557 100644
--- a/linux-user/sh4/target_syscall.h
+++ b/linux-user/sh4/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef SH4_TARGET_SYSCALL_H
+#define SH4_TARGET_SYSCALL_H
 
 struct target_pt_regs {
         unsigned long regs[16];
@@ -19,4 +19,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* SH4_TARGET_SYSCALL_H */
diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_syscall.h
index a73fa6d..326f674 100644
--- a/linux-user/sparc/target_syscall.h
+++ b/linux-user/sparc/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef SPARC_TARGET_SYSCALL_H
+#define SPARC_TARGET_SYSCALL_H
 
 struct target_pt_regs {
 	abi_ulong psr;
@@ -22,4 +22,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000
 #define TARGET_MLOCKALL_MCL_FUTURE  0x4000
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* SPARC_TARGET_SYSCALL_H */
diff --git a/linux-user/sparc64/target_syscall.h b/linux-user/sparc64/target_syscall.h
index eb827fc..b7e3bf8 100644
--- a/linux-user/sparc64/target_syscall.h
+++ b/linux-user/sparc64/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef SPARC64_TARGET_SYSCALL_H
+#define SPARC64_TARGET_SYSCALL_H
 
 struct target_pt_regs {
 	abi_ulong u_regs[16];
@@ -23,4 +23,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 0x2000
 #define TARGET_MLOCKALL_MCL_FUTURE  0x4000
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* SPARC64_TARGET_SYSCALL_H */
diff --git a/linux-user/tilegx/target_syscall.h b/linux-user/tilegx/target_syscall.h
index a938d4e..d731acd 100644
--- a/linux-user/tilegx/target_syscall.h
+++ b/linux-user/tilegx/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TILEGX_SYSCALLS_H
-#define TILEGX_SYSCALLS_H
+#ifndef TILEGX_TARGET_SYSCALL_H
+#define TILEGX_TARGET_SYSCALL_H
 
 #define UNAME_MACHINE "tilegx"
 #define UNAME_MINIMUM_RELEASE "3.19"
diff --git a/linux-user/unicore32/target_syscall.h b/linux-user/unicore32/target_syscall.h
index 385a975..346b207 100644
--- a/linux-user/unicore32/target_syscall.h
+++ b/linux-user/unicore32/target_syscall.h
@@ -5,8 +5,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef __UC32_SYSCALL_H__
-#define __UC32_SYSCALL_H__
+
+#ifndef UNICORE32_TARGET_SYSCALL_H
+#define UNICORE32_TARGET_SYSCALL_H
+
 struct target_pt_regs {
     abi_ulong uregs[34];
 };
@@ -57,4 +59,4 @@ struct target_pt_regs {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif /* __UC32_SYSCALL_H__ */
+#endif /* UNICORE32_TARGET_SYSCALL_H */
diff --git a/linux-user/x86_64/target_syscall.h b/linux-user/x86_64/target_syscall.h
index feecd32..983fb23 100644
--- a/linux-user/x86_64/target_syscall.h
+++ b/linux-user/x86_64/target_syscall.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SYSCALL_H
-#define TARGET_SYSCALL_H
+#ifndef X86_64_TARGET_SYSCALL_H
+#define X86_64_TARGET_SYSCALL_H
 
 #define __USER_CS	(0x33)
 #define __USER_DS	(0x2B)
@@ -104,4 +104,4 @@ struct target_msqid64_ds {
 #define TARGET_MLOCKALL_MCL_CURRENT 1
 #define TARGET_MLOCKALL_MCL_FUTURE  2
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* X86_64_TARGET_SYSCALL_H */
-- 
2.5.5

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

* [Qemu-devel] [PULL 05/18] linux-user: Clean up target_cpu.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (3 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 04/18] linux-user: Clean up target_syscall.h " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 06/18] linux-user: Clean up target_signal.h " Markus Armbruster
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

These headers all use TARGET_CPU_H as header guard symbol.  Reuse of
the same guard symbol in multiple headers is okay as long as they
cannot be included together.

Since we can avoid guard symbol reuse easily, do so: use guard symbol
$target_TARGET_CPU_H for linux-user/$target/target_cpu.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/aarch64/target_cpu.h    | 4 ++--
 linux-user/alpha/target_cpu.h      | 4 ++--
 linux-user/arm/target_cpu.h        | 4 ++--
 linux-user/cris/target_cpu.h       | 4 ++--
 linux-user/i386/target_cpu.h       | 6 +++---
 linux-user/m68k/target_cpu.h       | 4 ++--
 linux-user/microblaze/target_cpu.h | 4 ++--
 linux-user/mips/target_cpu.h       | 4 ++--
 linux-user/openrisc/target_cpu.h   | 4 ++--
 linux-user/ppc/target_cpu.h        | 4 ++--
 linux-user/s390x/target_cpu.h      | 4 ++--
 linux-user/sh4/target_cpu.h        | 4 ++--
 linux-user/sparc/target_cpu.h      | 4 ++--
 linux-user/tilegx/target_cpu.h     | 4 ++--
 linux-user/unicore32/target_cpu.h  | 4 ++--
 15 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h
index b5593dc..777ce29 100644
--- a/linux-user/aarch64/target_cpu.h
+++ b/linux-user/aarch64/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef AARCH64_TARGET_CPU_H
+#define AARCH64_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
 {
diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h
index 4256245..ad124da 100644
--- a/linux-user/alpha/target_cpu.h
+++ b/linux-user/alpha/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef ALPHA_TARGET_CPU_H
+#define ALPHA_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUAlphaState *env, target_ulong newsp)
 {
diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h
index 6832262..d888219 100644
--- a/linux-user/arm/target_cpu.h
+++ b/linux-user/arm/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef ARM_TARGET_CPU_H
+#define ARM_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
 {
diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h
index 4d787e5..c43aac6 100644
--- a/linux-user/cris/target_cpu.h
+++ b/linux-user/cris/target_cpu.h
@@ -17,8 +17,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef CRIS_TARGET_CPU_H
+#define CRIS_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUCRISState *env, target_ulong newsp)
 {
diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h
index 58f8645..7fbcf9b 100644
--- a/linux-user/i386/target_cpu.h
+++ b/linux-user/i386/target_cpu.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef I386_TARGET_CPU_H
+#define I386_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUX86State *env, target_ulong newsp)
 {
@@ -45,4 +45,4 @@ static inline void cpu_set_tls(CPUX86State *env, target_ulong newtls)
 }
 #endif /* defined(TARGET_ABI32) */
 
-#endif /* !defined(TARGET_CPU_H) */
+#endif /* I386_TARGET_CPU_H */
diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h
index bb4d3fa..cc0bfc2 100644
--- a/linux-user/m68k/target_cpu.h
+++ b/linux-user/m68k/target_cpu.h
@@ -18,8 +18,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef M68K_TARGET_CPU_H
+#define M68K_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp)
 {
diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/target_cpu.h
index c6386ea..7dd979f 100644
--- a/linux-user/microblaze/target_cpu.h
+++ b/linux-user/microblaze/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef MICROBLAZE_TARGET_CPU_H
+#define MICROBLAZE_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUMBState *env, target_ulong newsp)
 {
diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h
index 19b8855..2002920 100644
--- a/linux-user/mips/target_cpu.h
+++ b/linux-user/mips/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef MIPS_TARGET_CPU_H
+#define MIPS_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp)
 {
diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_cpu.h
index 32a46ac..a21ed1a 100644
--- a/linux-user/openrisc/target_cpu.h
+++ b/linux-user/openrisc/target_cpu.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef OPENRISC_TARGET_CPU_H
+#define OPENRISC_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong newsp)
 {
diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h
index 26f4ba2..3aab3d1 100644
--- a/linux-user/ppc/target_cpu.h
+++ b/linux-user/ppc/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef PPC_TARGET_CPU_H
+#define PPC_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUPPCState *env, target_ulong newsp)
 {
diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h
index f10abe8..87ea4d2 100644
--- a/linux-user/s390x/target_cpu.h
+++ b/linux-user/s390x/target_cpu.h
@@ -19,8 +19,8 @@
  * You should have received a copy of the GNU (Lesser) General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef S390X_TARGET_CPU_H
+#define S390X_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUS390XState *env, target_ulong newsp)
 {
diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h
index 141856f..9d305d2 100644
--- a/linux-user/sh4/target_cpu.h
+++ b/linux-user/sh4/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef SH4_TARGET_CPU_H
+#define SH4_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUSH4State *env, target_ulong newsp)
 {
diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h
index 4944d46..f2fe526 100644
--- a/linux-user/sparc/target_cpu.h
+++ b/linux-user/sparc/target_cpu.h
@@ -17,8 +17,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef SPARC_TARGET_CPU_H
+#define SPARC_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp)
 {
diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h
index c96e81d..4878e01 100644
--- a/linux-user/tilegx/target_cpu.h
+++ b/linux-user/tilegx/target_cpu.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef TILEGX_TARGET_CPU_H
+#define TILEGX_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUTLGState *env, target_ulong newsp)
 {
diff --git a/linux-user/unicore32/target_cpu.h b/linux-user/unicore32/target_cpu.h
index fb79087..d7d2e7b 100644
--- a/linux-user/unicore32/target_cpu.h
+++ b/linux-user/unicore32/target_cpu.h
@@ -8,8 +8,8 @@
  * published by the Free Software Foundation, or (at your option) any
  * later version. See the COPYING file in the top-level directory.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef UNICORE32_TARGET_CPU_H
+#define UNICORE32_TARGET_CPU_H
 
 static inline void cpu_clone_regs(CPUUniCore32State *env, target_ulong newsp)
 {
-- 
2.5.5

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

* [Qemu-devel] [PULL 06/18] linux-user: Clean up target_signal.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (4 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 05/18] linux-user: Clean up target_cpu.h " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 07/18] linux-user: Clean up target_structs.h " Markus Armbruster
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

These headers all use TARGET_SIGNAL_H as header guard symbol.  Reuse
of the same guard symbol in multiple headers is okay as long as they
cannot be included together.

Since we can avoid guard symbol reuse easily, do so: use guard symbol
$target_TARGET_SIGNAL_H for linux-user/$target/target_signal.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/aarch64/target_signal.h    | 6 +++---
 linux-user/alpha/target_signal.h      | 6 +++---
 linux-user/arm/target_signal.h        | 6 +++---
 linux-user/cris/target_signal.h       | 6 +++---
 linux-user/i386/target_signal.h       | 6 +++---
 linux-user/m68k/target_signal.h       | 6 +++---
 linux-user/microblaze/target_signal.h | 6 +++---
 linux-user/mips/target_signal.h       | 6 +++---
 linux-user/mips64/target_signal.h     | 6 +++---
 linux-user/openrisc/target_signal.h   | 6 +++---
 linux-user/ppc/target_signal.h        | 6 +++---
 linux-user/s390x/target_signal.h      | 6 +++---
 linux-user/sh4/target_signal.h        | 6 +++---
 linux-user/sparc/target_signal.h      | 6 +++---
 linux-user/sparc64/target_signal.h    | 6 +++---
 linux-user/tilegx/target_signal.h     | 6 +++---
 linux-user/unicore32/target_signal.h  | 6 +++---
 linux-user/x86_64/target_signal.h     | 6 +++---
 18 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/linux-user/aarch64/target_signal.h b/linux-user/aarch64/target_signal.h
index e8c677d..e66367c 100644
--- a/linux-user/aarch64/target_signal.h
+++ b/linux-user/aarch64/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef AARCH64_TARGET_SIGNAL_H
+#define AARCH64_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -26,4 +26,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
    return state->xregs[31];
 }
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* AARCH64_TARGET_SIGNAL_H */
diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h
index 4c78319..f1ed00d 100644
--- a/linux-user/alpha/target_signal.h
+++ b/linux-user/alpha/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef ALPHA_TARGET_SIGNAL_H
+#define ALPHA_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -55,4 +55,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state)
 #define TARGET_GEN_SUBRNG6     -24
 #define TARGET_GEN_SUBRNG7     -25
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* ALPHA_TARGET_SIGNAL_H */
diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h
index fb31f4c..cbbeb09 100644
--- a/linux-user/arm/target_signal.h
+++ b/linux-user/arm/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef ARM_TARGET_SIGNAL_H
+#define ARM_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* ARM_TARGET_SIGNAL_H */
diff --git a/linux-user/cris/target_signal.h b/linux-user/cris/target_signal.h
index e0f1382..664621b 100644
--- a/linux-user/cris/target_signal.h
+++ b/linux-user/cris/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef CRIS_TARGET_SIGNAL_H
+#define CRIS_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* CRIS_TARGET_SIGNAL_H */
diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h
index 9baf7fb..837e90f 100644
--- a/linux-user/i386/target_signal.h
+++ b/linux-user/i386/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef I386_TARGET_SIGNAL_H
+#define I386_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -26,4 +26,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
     return state->regs[R_ESP];
 }
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* I386_TARGET_SIGNAL_H */
diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h
index 9deaa89..9d2d734 100644
--- a/linux-user/m68k/target_signal.h
+++ b/linux-user/m68k/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef M68K_TARGET_SIGNAL_H
+#define M68K_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* M68K_TARGET_SIGNAL_H */
diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h
index acdf3b5..de2b0f4 100644
--- a/linux-user/microblaze/target_signal.h
+++ b/linux-user/microblaze/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef MICROBLAZE_TARGET_SIGNAL_H
+#define MICROBLAZE_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUMBState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* MICROBLAZE_TARGET_SIGNAL_H */
diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h
index 460cc9f..8dd27ce 100644
--- a/linux-user/mips/target_signal.h
+++ b/linux-user/mips/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef MIPS_TARGET_SIGNAL_H
+#define MIPS_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* MIPS_TARGET_SIGNAL_H */
diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h
index a2dc514..67ef5a1 100644
--- a/linux-user/mips64/target_signal.h
+++ b/linux-user/mips64/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef MIPS64_TARGET_SIGNAL_H
+#define MIPS64_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* MIPS64_TARGET_SIGNAL_H */
diff --git a/linux-user/openrisc/target_signal.h b/linux-user/openrisc/target_signal.h
index f600501..9f2c493 100644
--- a/linux-user/openrisc/target_signal.h
+++ b/linux-user/openrisc/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef OPENRISC_TARGET_SIGNAL_H
+#define OPENRISC_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -24,4 +24,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUOpenRISCState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* OPENRISC_TARGET_SIGNAL_H */
diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h
index 4f01dd4..865c52f 100644
--- a/linux-user/ppc/target_signal.h
+++ b/linux-user/ppc/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef PPC_TARGET_SIGNAL_H
+#define PPC_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* PPC_TARGET_SIGNAL_H */
diff --git a/linux-user/s390x/target_signal.h b/linux-user/s390x/target_signal.h
index a6fb287..6f7b6ab 100644
--- a/linux-user/s390x/target_signal.h
+++ b/linux-user/s390x/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef S390X_TARGET_SIGNAL_H
+#define S390X_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -24,4 +24,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* S390X_TARGET_SIGNAL_H */
diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h
index f9911aa..cbf23b6 100644
--- a/linux-user/sh4/target_signal.h
+++ b/linux-user/sh4/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef SH4_TARGET_SIGNAL_H
+#define SH4_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* SH4_TARGET_SIGNAL_H */
diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_signal.h
index 2df38c8..e445e2b 100644
--- a/linux-user/sparc/target_signal.h
+++ b/linux-user/sparc/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef SPARC_TARGET_SIGNAL_H
+#define SPARC_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -34,4 +34,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* SPARC_TARGET_SIGNAL_H */
diff --git a/linux-user/sparc64/target_signal.h b/linux-user/sparc64/target_signal.h
index 2df38c8..4449457 100644
--- a/linux-user/sparc64/target_signal.h
+++ b/linux-user/sparc64/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef SPARC64_TARGET_SIGNAL_H
+#define SPARC64_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -34,4 +34,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* SPARC64_TARGET_SIGNAL_H */
diff --git a/linux-user/tilegx/target_signal.h b/linux-user/tilegx/target_signal.h
index fcf1040..f64551a 100644
--- a/linux-user/tilegx/target_signal.h
+++ b/linux-user/tilegx/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef TILEGX_TARGET_SIGNAL_H
+#define TILEGX_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -26,4 +26,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUTLGState *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* TILEGX_TARGET_SIGNAL_H */
diff --git a/linux-user/unicore32/target_signal.h b/linux-user/unicore32/target_signal.h
index 7c44238..c6496fb 100644
--- a/linux-user/unicore32/target_signal.h
+++ b/linux-user/unicore32/target_signal.h
@@ -5,8 +5,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef UNICORE32_TARGET_SIGNAL_H
+#define UNICORE32_TARGET_SIGNAL_H
 
 /* this struct defines a stack used during syscall handling */
 typedef struct target_sigaltstack {
@@ -27,4 +27,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUUniCore32State *state)
 }
 
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* UNICORE32_TARGET_SIGNAL_H */
diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h
index 9baf7fb..1e95f4a 100644
--- a/linux-user/x86_64/target_signal.h
+++ b/linux-user/x86_64/target_signal.h
@@ -1,5 +1,5 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
+#ifndef X86_64_TARGET_SIGNAL_H
+#define X86_64_TARGET_SIGNAL_H
 
 #include "cpu.h"
 
@@ -26,4 +26,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
     return state->regs[R_ESP];
 }
 
-#endif /* TARGET_SIGNAL_H */
+#endif /* X86_64_TARGET_SIGNAL_H */
-- 
2.5.5

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

* [Qemu-devel] [PULL 07/18] linux-user: Clean up target_structs.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (5 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 06/18] linux-user: Clean up target_signal.h " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 08/18] linux-user: Clean up hostdep.h " Markus Armbruster
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

These headers all use TARGET_STRUCTS_H as header guard symbol.  Reuse
of the same guard symbol in multiple headers is okay as long as they
cannot be included together.

Since we can avoid guard symbol reuse easily, do so: use guard symbol
$target_TARGET_STRUCTS_H for linux-user/$target/target_structs.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/aarch64/target_structs.h    | 4 ++--
 linux-user/alpha/target_structs.h      | 4 ++--
 linux-user/arm/target_structs.h        | 4 ++--
 linux-user/cris/target_structs.h       | 4 ++--
 linux-user/i386/target_structs.h       | 4 ++--
 linux-user/m68k/target_structs.h       | 4 ++--
 linux-user/microblaze/target_structs.h | 4 ++--
 linux-user/mips/target_structs.h       | 4 ++--
 linux-user/openrisc/target_structs.h   | 4 ++--
 linux-user/ppc/target_structs.h        | 4 ++--
 linux-user/s390x/target_structs.h      | 4 ++--
 linux-user/sh4/target_structs.h        | 4 ++--
 linux-user/sparc/target_structs.h      | 4 ++--
 linux-user/sparc64/target_structs.h    | 4 ++--
 linux-user/tilegx/target_structs.h     | 4 ++--
 linux-user/unicore32/target_structs.h  | 4 ++--
 linux-user/x86_64/target_structs.h     | 4 ++--
 17 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/linux-user/aarch64/target_structs.h b/linux-user/aarch64/target_structs.h
index 21c1f2c..a4998a7 100644
--- a/linux-user/aarch64/target_structs.h
+++ b/linux-user/aarch64/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef AARCH64_TARGET_STRUCTS_H
+#define AARCH64_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/alpha/target_structs.h b/linux-user/alpha/target_structs.h
index 50e7708..db2bfe2 100644
--- a/linux-user/alpha/target_structs.h
+++ b/linux-user/alpha/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef ALPHA_TARGET_STRUCTS_H
+#define ALPHA_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/arm/target_structs.h b/linux-user/arm/target_structs.h
index f3c85d4..0bf034c 100644
--- a/linux-user/arm/target_structs.h
+++ b/linux-user/arm/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef ARM_TARGET_STRUCTS_H
+#define ARM_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/cris/target_structs.h b/linux-user/cris/target_structs.h
index e4a1ffb..76f9653 100644
--- a/linux-user/cris/target_structs.h
+++ b/linux-user/cris/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef CRIS_TARGET_STRUCTS_H
+#define CRIS_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/i386/target_structs.h b/linux-user/i386/target_structs.h
index 65f535e..25388a7 100644
--- a/linux-user/i386/target_structs.h
+++ b/linux-user/i386/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef I386_TARGET_STRUCTS_H
+#define I386_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/m68k/target_structs.h b/linux-user/m68k/target_structs.h
index de257c9..a003676 100644
--- a/linux-user/m68k/target_structs.h
+++ b/linux-user/m68k/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef M68K_TARGET_STRUCTS_H
+#define M68K_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/microblaze/target_structs.h b/linux-user/microblaze/target_structs.h
index 325e2f6..70dbdb6 100644
--- a/linux-user/microblaze/target_structs.h
+++ b/linux-user/microblaze/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef MICROBLAZE_TARGET_STRUCTS_H
+#define MICROBLAZE_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/mips/target_structs.h b/linux-user/mips/target_structs.h
index 16021e8..fbd9955 100644
--- a/linux-user/mips/target_structs.h
+++ b/linux-user/mips/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef MIPS_TARGET_STRUCTS_H
+#define MIPS_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/openrisc/target_structs.h b/linux-user/openrisc/target_structs.h
index f4d560f..afbb7ad 100644
--- a/linux-user/openrisc/target_structs.h
+++ b/linux-user/openrisc/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef OPENRISC_TARGET_STRUCTS_H
+#define OPENRISC_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/ppc/target_structs.h b/linux-user/ppc/target_structs.h
index 2b87613..6b1f579 100644
--- a/linux-user/ppc/target_structs.h
+++ b/linux-user/ppc/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef PPC_TARGET_STRUCTS_H
+#define PPC_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/s390x/target_structs.h b/linux-user/s390x/target_structs.h
index 6b6f5b5..cadff6d 100644
--- a/linux-user/s390x/target_structs.h
+++ b/linux-user/s390x/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef S390X_TARGET_STRUCTS_H
+#define S390X_TARGET_STRUCTS_H
 
 
 struct target_ipc_perm {
diff --git a/linux-user/sh4/target_structs.h b/linux-user/sh4/target_structs.h
index 32b235e..3e832bf 100644
--- a/linux-user/sh4/target_structs.h
+++ b/linux-user/sh4/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef SH4_TARGET_STRUCTS_H
+#define SH4_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/sparc/target_structs.h b/linux-user/sparc/target_structs.h
index c139e09..ee24c3b 100644
--- a/linux-user/sparc/target_structs.h
+++ b/linux-user/sparc/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef SPARC_TARGET_STRUCTS_H
+#define SPARC_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/sparc64/target_structs.h b/linux-user/sparc64/target_structs.h
index fc17290..1808132 100644
--- a/linux-user/sparc64/target_structs.h
+++ b/linux-user/sparc64/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef SPARC64_TARGET_STRUCTS_H
+#define SPARC64_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/tilegx/target_structs.h b/linux-user/tilegx/target_structs.h
index 7d3ff78..de8b1f2 100644
--- a/linux-user/tilegx/target_structs.h
+++ b/linux-user/tilegx/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef TILEGX_TARGET_STRUCTS_H
+#define TILEGX_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/unicore32/target_structs.h b/linux-user/unicore32/target_structs.h
index 7893695..fbd4fa3 100644
--- a/linux-user/unicore32/target_structs.h
+++ b/linux-user/unicore32/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef UNICORE32_TARGET_STRUCTS_H
+#define UNICORE32_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
diff --git a/linux-user/x86_64/target_structs.h b/linux-user/x86_64/target_structs.h
index d934056..3489827 100644
--- a/linux-user/x86_64/target_structs.h
+++ b/linux-user/x86_64/target_structs.h
@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_STRUCTS_H
-#define TARGET_STRUCTS_H
+#ifndef X86_64_TARGET_STRUCTS_H
+#define X86_64_TARGET_STRUCTS_H
 
 struct target_ipc_perm {
     abi_int __key;                      /* Key.  */
-- 
2.5.5

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

* [Qemu-devel] [PULL 08/18] linux-user: Clean up hostdep.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (6 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 07/18] linux-user: Clean up target_structs.h " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 09/18] linux-user: Fix broken header guard in syscall_defs.h Markus Armbruster
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

These headers all use QEMU_HOSTDEP_H as header guard symbol.  Reuse of
the same guard symbol in multiple headers is okay as long as they
cannot be included together.

Since we can avoid guard symbol reuse easily, do so: use guard symbol
$target_HOSTDEP_H for linux-user/host/$target/hostdep.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/host/aarch64/hostdep.h | 4 ++--
 linux-user/host/arm/hostdep.h     | 4 ++--
 linux-user/host/i386/hostdep.h    | 4 ++--
 linux-user/host/ia64/hostdep.h    | 4 ++--
 linux-user/host/mips/hostdep.h    | 4 ++--
 linux-user/host/ppc/hostdep.h     | 4 ++--
 linux-user/host/ppc64/hostdep.h   | 4 ++--
 linux-user/host/s390/hostdep.h    | 4 ++--
 linux-user/host/s390x/hostdep.h   | 4 ++--
 linux-user/host/sparc/hostdep.h   | 4 ++--
 linux-user/host/sparc64/hostdep.h | 4 ++--
 linux-user/host/x32/hostdep.h     | 4 ++--
 linux-user/host/x86_64/hostdep.h  | 4 ++--
 13 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
index b79eaf1..64f75ce 100644
--- a/linux-user/host/aarch64/hostdep.h
+++ b/linux-user/host/aarch64/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef AARCH64_HOSTDEP_H
+#define AARCH64_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h
index 8e1ff2f..5c1ae60 100644
--- a/linux-user/host/arm/hostdep.h
+++ b/linux-user/host/arm/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef ARM_HOSTDEP_H
+#define ARM_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h
index 5a12f4a..d834bd8 100644
--- a/linux-user/host/i386/hostdep.h
+++ b/linux-user/host/i386/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef I386_HOSTDEP_H
+#define I386_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
diff --git a/linux-user/host/ia64/hostdep.h b/linux-user/host/ia64/hostdep.h
index 7609bf5..263bf76 100644
--- a/linux-user/host/ia64/hostdep.h
+++ b/linux-user/host/ia64/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef IA64_HOSTDEP_H
+#define IA64_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/mips/hostdep.h b/linux-user/host/mips/hostdep.h
index 7609bf5..ba111d7 100644
--- a/linux-user/host/mips/hostdep.h
+++ b/linux-user/host/mips/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef MIPS_HOSTDEP_H
+#define MIPS_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/ppc/hostdep.h b/linux-user/host/ppc/hostdep.h
index 7609bf5..23d8bd9 100644
--- a/linux-user/host/ppc/hostdep.h
+++ b/linux-user/host/ppc/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef PPC_HOSTDEP_H
+#define PPC_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h
index 310e7d1..0b0f5f7 100644
--- a/linux-user/host/ppc64/hostdep.h
+++ b/linux-user/host/ppc64/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef PPC64_HOSTDEP_H
+#define PPC64_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
diff --git a/linux-user/host/s390/hostdep.h b/linux-user/host/s390/hostdep.h
index 7609bf5..afcba5a 100644
--- a/linux-user/host/s390/hostdep.h
+++ b/linux-user/host/s390/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef S390_HOSTDEP_H
+#define S390_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h
index e95871c..6f9da9c 100644
--- a/linux-user/host/s390x/hostdep.h
+++ b/linux-user/host/s390x/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef S390X_HOSTDEP_H
+#define S390X_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
diff --git a/linux-user/host/sparc/hostdep.h b/linux-user/host/sparc/hostdep.h
index 7609bf5..391ad92 100644
--- a/linux-user/host/sparc/hostdep.h
+++ b/linux-user/host/sparc/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef SPARC_HOSTDEP_H
+#define SPARC_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/sparc64/hostdep.h b/linux-user/host/sparc64/hostdep.h
index 7609bf5..ce3968f 100644
--- a/linux-user/host/sparc64/hostdep.h
+++ b/linux-user/host/sparc64/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef SPARC64_HOSTDEP_H
+#define SPARC64_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/x32/hostdep.h b/linux-user/host/x32/hostdep.h
index 7609bf5..2c2d6d3 100644
--- a/linux-user/host/x32/hostdep.h
+++ b/linux-user/host/x32/hostdep.h
@@ -9,7 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef X32_HOSTDEP_H
+#define X32_HOSTDEP_H
 
 #endif
diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h
index 9dfbf3a..3b42596 100644
--- a/linux-user/host/x86_64/hostdep.h
+++ b/linux-user/host/x86_64/hostdep.h
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_HOSTDEP_H
-#define QEMU_HOSTDEP_H
+#ifndef X86_64_HOSTDEP_H
+#define X86_64_HOSTDEP_H
 
 /* We have a safe-syscall.inc.S */
 #define HAVE_SAFE_SYSCALL
-- 
2.5.5

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

* [Qemu-devel] [PULL 09/18] linux-user: Fix broken header guard in syscall_defs.h
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (7 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 08/18] linux-user: Clean up hostdep.h " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 10/18] tcg: Clean up tcg-target.h header guards Markus Armbruster
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Found with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/syscall_defs.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index dce1bcc..b43966e 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -5,8 +5,7 @@
    necessary */
 
 #ifndef SYSCALL_DEFS_H
-#define SYSCALL_DEFS_H 1
-
+#define SYSCALL_DEFS_H
 
 #include "syscall_nr.h"
 
@@ -2577,8 +2576,6 @@ struct target_ucred {
     uint32_t gid;
 };
 
-#endif
-
 typedef int32_t target_timer_t;
 
 #define TARGET_SIGEV_MAX_SIZE 64
@@ -2620,3 +2617,5 @@ struct target_user_cap_data {
     uint32_t permitted;
     uint32_t inheritable;
 };
+
+#endif
-- 
2.5.5

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

* [Qemu-devel] [PULL 10/18] tcg: Clean up tcg-target.h header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (8 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 09/18] linux-user: Fix broken header guard in syscall_defs.h Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 11/18] spapr_pci: Include spapr.h instead of playing games with #error Markus Armbruster
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

These use guard symbols like TCG_TARGET_$target.
scripts/clean-header-guards.pl doesn't like them because they don't
match their file name (they should, to make guard collisions less
likely).

Clean them up: use guard symbol $target_TCG_TARGET_H for
tcg/$target/tcg-target.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 tcg/aarch64/tcg-target.h | 6 +++---
 tcg/arm/tcg-target.h     | 5 +++--
 tcg/i386/tcg-target.h    | 5 +++--
 tcg/ia64/tcg-target.h    | 5 +++--
 tcg/mips/tcg-target.h    | 5 +++--
 tcg/ppc/tcg-target.h     | 5 +++--
 tcg/s390/tcg-target.h    | 5 +++--
 tcg/sparc/tcg-target.h   | 5 +++--
 8 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
index 19a04a6..a1d101f 100644
--- a/tcg/aarch64/tcg-target.h
+++ b/tcg/aarch64/tcg-target.h
@@ -10,8 +10,8 @@
  * See the COPYING file in the top-level directory for details.
  */
 
-#ifndef TCG_TARGET_AARCH64
-#define TCG_TARGET_AARCH64 1
+#ifndef AARCH64_TCG_TARGET_H
+#define AARCH64_TCG_TARGET_H
 
 #define TCG_TARGET_INSN_UNIT_SIZE  4
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 24
@@ -106,4 +106,4 @@ static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
     __builtin___clear_cache((char *)start, (char *)stop);
 }
 
-#endif /* TCG_TARGET_AARCH64 */
+#endif /* AARCH64_TCG_TARGET_H */
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 6559f80..a0e1acf 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_ARM 
-#define TCG_TARGET_ARM 1
+
+#ifndef ARM_TCG_TARGET_H
+#define ARM_TCG_TARGET_H
 
 #undef TCG_TARGET_STACK_GROWSUP
 #define TCG_TARGET_INSN_UNIT_SIZE 4
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 92be341..524cfc6 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_I386 
-#define TCG_TARGET_I386 1
+
+#ifndef I386_TCG_TARGET_H
+#define I386_TCG_TARGET_H
 
 #define TCG_TARGET_INSN_UNIT_SIZE  1
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 31
diff --git a/tcg/ia64/tcg-target.h b/tcg/ia64/tcg-target.h
index ae9b79f..6dddb7f 100644
--- a/tcg/ia64/tcg-target.h
+++ b/tcg/ia64/tcg-target.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_IA64 
-#define TCG_TARGET_IA64 1
+
+#ifndef IA64_TCG_TARGET_H
+#define IA64_TCG_TARGET_H
 
 #define TCG_TARGET_INSN_UNIT_SIZE 16
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 21
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index b1cda37..3aeac87 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -23,8 +23,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_MIPS 
-#define TCG_TARGET_MIPS 1
+
+#ifndef MIPS_TCG_TARGET_H
+#define MIPS_TCG_TARGET_H
 
 #define TCG_TARGET_INSN_UNIT_SIZE 4
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 16
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index b4f0818..dd032f2 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_PPC64 
-#define TCG_TARGET_PPC64 1
+
+#ifndef PPC_TCG_TARGET_H
+#define PPC_TCG_TARGET_H
 
 #ifdef _ARCH_PPC64
 # define TCG_TARGET_REG_BITS  64
diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
index d9dc038..0c1af24 100644
--- a/tcg/s390/tcg-target.h
+++ b/tcg/s390/tcg-target.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_S390 
-#define TCG_TARGET_S390 1
+
+#ifndef S390_TCG_TARGET_H
+#define S390_TCG_TARGET_H
 
 #define TCG_TARGET_INSN_UNIT_SIZE 2
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 19
diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h
index 2cd72d2..88f9c90 100644
--- a/tcg/sparc/tcg-target.h
+++ b/tcg/sparc/tcg-target.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef TCG_TARGET_SPARC 
-#define TCG_TARGET_SPARC 1
+
+#ifndef SPARC_TCG_TARGET_H
+#define SPARC_TCG_TARGET_H
 
 #define TCG_TARGET_REG_BITS 64
 
-- 
2.5.5

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

* [Qemu-devel] [PULL 11/18] spapr_pci: Include spapr.h instead of playing games with #error
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (9 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 10/18] tcg: Clean up tcg-target.h header guards Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 12/18] Drop Emacs local variables lists redundant with .dir-locals.el Markus Armbruster
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

include/hw/pci-host/spapr.h needs hw/ppc/spapr.h.  It checks whether
its header guard is defined, and errors out if it isn't.

Playing games with some other header's guard symbol is not a good
idea.  Just include the frackin' header already.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 include/hw/pci-host/spapr.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 193631d..7b63243 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -16,13 +16,11 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#if !defined(__HW_SPAPR_H__)
-#error Please include spapr.h before this file!
-#endif
 
 #if !defined(__HW_SPAPR_PCI_H__)
 #define __HW_SPAPR_PCI_H__
 
+#include "hw/ppc/spapr.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ppc/xics.h"
-- 
2.5.5

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

* [Qemu-devel] [PULL 12/18] Drop Emacs local variables lists redundant with .dir-locals.el
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (10 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 11/18] spapr_pci: Include spapr.h instead of playing games with #error Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 13/18] Clean up header guards that don't match their file name Markus Armbruster
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 hw/pci-bridge/ioh3420.c            |  9 ---------
 hw/pci-bridge/xio3130_downstream.c |  9 ---------
 hw/pci-bridge/xio3130_upstream.c   | 10 ----------
 include/qemu/acl.h                 |  8 --------
 monitor.c                          |  9 ---------
 util/acl.c                         |  9 ---------
 6 files changed, 54 deletions(-)

diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index 93c6f0b..0444b59 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -216,12 +216,3 @@ static void ioh3420_register_types(void)
 }
 
 type_init(ioh3420_register_types)
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- *  indent-tab-mode: nil
- * End:
- */
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
index f6149a3..cef6e13 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -203,12 +203,3 @@ static void xio3130_downstream_register_types(void)
 }
 
 type_init(xio3130_downstream_register_types)
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- *  indent-tab-mode: nil
- * End:
- */
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index 487edac..4ad0440 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -174,13 +174,3 @@ static void xio3130_upstream_register_types(void)
 }
 
 type_init(xio3130_upstream_register_types)
-
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- *  indent-tab-mode: nil
- * End:
- */
diff --git a/include/qemu/acl.h b/include/qemu/acl.h
index 116487e..4a403b7 100644
--- a/include/qemu/acl.h
+++ b/include/qemu/acl.h
@@ -64,11 +64,3 @@ int qemu_acl_remove(qemu_acl *acl,
 		    const char *match);
 
 #endif /* __QEMU_ACL_H__ */
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- * End:
- */
diff --git a/monitor.c b/monitor.c
index d6335d3..d0ff246 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4093,15 +4093,6 @@ static void sortcmdlist(void)
     qsort((void *)info_cmds, array_num, elem_size, compare_mon_cmd);
 }
 
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- * End:
- */
-
 /* These functions just adapt the readline interface in a typesafe way.  We
  * could cast function pointers but that discards compiler checks.
  */
diff --git a/util/acl.c b/util/acl.c
index 723b6a8..c105add 100644
--- a/util/acl.c
+++ b/util/acl.c
@@ -177,12 +177,3 @@ int qemu_acl_remove(qemu_acl *acl,
     }
     return -1;
 }
-
-
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 8
- * End:
- */
-- 
2.5.5

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

* [Qemu-devel] [PULL 13/18] Clean up header guards that don't match their file name
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (11 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 12/18] Drop Emacs local variables lists redundant with .dir-locals.el Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 14/18] libdecnumber: Don't fool around with guards to avoid #include Markus Armbruster
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Header guard symbols should match their file name to make guard
collisions less likely.  Offenders found with
scripts/clean-header-guards.pl -vn.

Cleaned up with scripts/clean-header-guards.pl, followed by some
renaming of new guard symbols picked by the script to better ones.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 crypto/blockpriv.h                       | 6 +++---
 crypto/ivgenpriv.h                       | 6 +++---
 crypto/tlscredspriv.h                    | 7 +++----
 fsdev/file-op-9p.h                       | 6 ++++--
 hw/9pfs/9p-synth.h                       | 4 ++--
 hw/alpha/alpha_sys.h                     | 4 ++--
 hw/lm32/milkymist-hw.h                   | 6 +++---
 hw/net/e1000_regs.h                      | 7 +++----
 hw/pci-bridge/dec.h                      | 4 ++--
 hw/ppc/ppc405.h                          | 6 +++---
 hw/scsi/mfi.h                            | 6 +++---
 hw/tpm/tpm_util.h                        | 7 ++++---
 hw/usb/hcd-ehci.h                        | 5 +++--
 include/block/scsi.h                     | 5 +++--
 include/crypto/desrfb.h                  | 5 +++--
 include/crypto/tlscreds.h                | 7 +++----
 include/crypto/tlscredsanon.h            | 7 +++----
 include/crypto/tlscredsx509.h            | 7 +++----
 include/crypto/tlssession.h              | 6 +++---
 include/disas/bfd.h                      | 6 +++---
 include/exec/address-spaces.h            | 4 ++--
 include/exec/helper-head.h               | 7 +++----
 include/exec/user/abitypes.h             | 5 +++--
 include/hw/acpi/aml-build.h              | 4 ++--
 include/hw/acpi/cpu_hotplug.h            | 5 +++--
 include/hw/arm/arm.h                     | 6 +++---
 include/hw/arm/stm32f205_soc.h           | 4 ++--
 include/hw/audio/audio.h                 | 4 ++--
 include/hw/block/block.h                 | 4 ++--
 include/hw/char/pl011.h                  | 4 ++--
 include/hw/cris/etraxfs.h                | 4 ++--
 include/hw/intc/allwinner-a10-pic.h      | 4 ++--
 include/hw/misc/arm_integrator_debug.h   | 5 +++--
 include/hw/misc/auxbus.h                 | 6 +++---
 include/hw/misc/mips_cmgcr.h             | 6 +++---
 include/hw/misc/tmp105_regs.h            | 5 +++--
 include/hw/net/allwinner_emac.h          | 5 +++--
 include/hw/nvram/openbios_firmware_abi.h | 6 +++---
 include/hw/pci-host/apb.h                | 4 ++--
 include/hw/pci-host/ppce500.h            | 4 ++--
 include/hw/pci-host/spapr.h              | 6 +++---
 include/hw/ppc/ppc4xx.h                  | 6 +++---
 include/hw/s390x/ioinst.h                | 4 ++--
 include/hw/ssi/xilinx_spips.h            | 6 +++---
 include/hw/timer/a9gtimer.h              | 6 +++---
 include/hw/timer/allwinner-a10-pit.h     | 4 ++--
 include/hw/timer/hpet.h                  | 5 +++--
 include/hw/timer/m48t59.h                | 6 +++---
 include/hw/timer/mc146818rtc_regs.h      | 5 +++--
 include/hw/tricore/tricore.h             | 4 ++--
 include/hw/vfio/vfio.h                   | 4 ++--
 include/hw/virtio/virtio-gpu.h           | 4 ++--
 include/libdecnumber/decNumberLocal.h    | 5 +++--
 include/migration/block.h                | 6 +++---
 include/monitor/hmp-target.h             | 7 ++++---
 include/monitor/qdev.h                   | 4 ++--
 include/qapi/qmp/dispatch.h              | 5 ++---
 include/qapi/qmp/types.h                 | 6 +++---
 include/qapi/visitor.h                   | 5 +++--
 include/qemu/config-file.h               | 6 +++---
 include/qemu/error-report.h              | 5 ++---
 include/qemu/fifo8.h                     | 6 +++---
 include/qemu/option.h                    | 4 ++--
 include/qemu/option_int.h                | 4 ++--
 include/qemu/sockets.h                   | 8 +++++---
 include/sysemu/bt.h                      | 4 ++--
 include/sysemu/hostmem.h                 | 5 +++--
 include/sysemu/tpm_backend.h             | 4 ++--
 include/sysemu/tpm_backend_int.h         | 7 +++----
 net/tap_int.h                            | 6 +++---
 qga/service-win32.h                      | 5 +++--
 qga/vss-win32/vss-common.h               | 4 ++--
 slirp/ip6_icmp.h                         | 4 ++--
 slirp/slirp.h                            | 4 ++--
 target-i386/hyperv.h                     | 4 ++--
 target-openrisc/exception.h              | 6 +++---
 target-tilegx/opcode_tilegx.h            | 6 +++---
 target-xtensa/core-dc232b/core-isa.h     | 7 +++----
 target-xtensa/core-dc233c/core-isa.h     | 7 +++----
 target-xtensa/core-fsf/core-isa.h        | 7 +++----
 ui/vnc-enc-tight.h                       | 6 +++---
 ui/vnc-enc-zrle.h                        | 4 ++--
 ui/vnc-enc-zywrle.h                      | 4 ++--
 83 files changed, 223 insertions(+), 215 deletions(-)

diff --git a/crypto/blockpriv.h b/crypto/blockpriv.h
index 6297085..15b547d 100644
--- a/crypto/blockpriv.h
+++ b/crypto/blockpriv.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_BLOCK_PRIV_H__
-#define QCRYPTO_BLOCK_PRIV_H__
+#ifndef QCRYPTO_BLOCKPRIV_H
+#define QCRYPTO_BLOCKPRIV_H
 
 #include "crypto/block.h"
 
@@ -89,4 +89,4 @@ int qcrypto_block_encrypt_helper(QCryptoCipher *cipher,
                                  size_t len,
                                  Error **errp);
 
-#endif /* QCRYPTO_BLOCK_PRIV_H__ */
+#endif /* QCRYPTO_BLOCKPRIV_H */
diff --git a/crypto/ivgenpriv.h b/crypto/ivgenpriv.h
index 7b87e02..28e5c67 100644
--- a/crypto/ivgenpriv.h
+++ b/crypto/ivgenpriv.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_IVGEN_PRIV_H__
-#define QCRYPTO_IVGEN_PRIV_H__
+#ifndef QCRYPTO_IVGENPRIV_H
+#define QCRYPTO_IVGENPRIV_H
 
 #include "crypto/ivgen.h"
 
@@ -46,4 +46,4 @@ struct QCryptoIVGen {
 };
 
 
-#endif /* QCRYPTO_IVGEN_PRIV_H__ */
+#endif /* QCRYPTO_IVGENPRIV_H */
diff --git a/crypto/tlscredspriv.h b/crypto/tlscredspriv.h
index 9222be4..13e9b6c 100644
--- a/crypto/tlscredspriv.h
+++ b/crypto/tlscredspriv.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_TLSCRED_PRIV_H__
-#define QCRYPTO_TLSCRED_PRIV_H__
+#ifndef QCRYPTO_TLSCREDSPRIV_H
+#define QCRYPTO_TLSCREDSPRIV_H
 
 #include "crypto/tlscreds.h"
 
@@ -38,5 +38,4 @@ int qcrypto_tls_creds_get_dh_params_file(QCryptoTLSCreds *creds,
 
 #endif
 
-#endif /* QCRYPTO_TLSCRED_PRIV_H__ */
-
+#endif /* QCRYPTO_TLSCREDSPRIV_H */
diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
index b1338ba..6db9fea 100644
--- a/fsdev/file-op-9p.h
+++ b/fsdev/file-op-9p.h
@@ -10,8 +10,10 @@
  * the COPYING file in the top-level directory.
  *
  */
-#ifndef _FILEOP_H
-#define _FILEOP_H
+
+#ifndef FILE_OP_9P_H
+#define FILE_OP_9P_H
+
 #include <dirent.h>
 #include <utime.h>
 #include <sys/vfs.h>
diff --git a/hw/9pfs/9p-synth.h b/hw/9pfs/9p-synth.h
index 7c8441b..6bcb44a 100644
--- a/hw/9pfs/9p-synth.h
+++ b/hw/9pfs/9p-synth.h
@@ -10,9 +10,9 @@
  * the COPYING file in the top-level directory.
  *
  */
-#ifndef HW_9PFS_SYNTH_H
-#define HW_9PFS_SYNTH_H 1
 
+#ifndef QEMU_9P_SYNTH_H
+#define QEMU_9P_SYNTH_H
 
 typedef struct V9fsSynthNode V9fsSynthNode;
 typedef ssize_t (*v9fs_synth_read)(void *buf, int len, off_t offset,
diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index fcaeb2b..ed911f2 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -1,7 +1,7 @@
 /* Alpha cores and system support chips.  */
 
-#ifndef HW_ALPHA_H
-#define HW_ALPHA_H 1
+#ifndef HW_ALPHA_SYS_H
+#define HW_ALPHA_SYS_H
 
 #include "target-alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
index eb6a3a2..4418b44 100644
--- a/hw/lm32/milkymist-hw.h
+++ b/hw/lm32/milkymist-hw.h
@@ -1,5 +1,5 @@
-#ifndef QEMU_HW_MILKYMIST_H
-#define QEMU_HW_MILKYMIST_H
+#ifndef QEMU_HW_MILKYMIST_HW_H
+#define QEMU_HW_MILKYMIST_HW_H
 
 #include "hw/qdev.h"
 #include "net/net.h"
@@ -203,4 +203,4 @@ static inline DeviceState *milkymist_softusb_create(hwaddr base,
     return dev;
 }
 
-#endif /* QEMU_HW_MILKYMIST_H */
+#endif /* QEMU_HW_MILKYMIST_HW_H */
diff --git a/hw/net/e1000_regs.h b/hw/net/e1000_regs.h
index c1acd45..23eed50 100644
--- a/hw/net/e1000_regs.h
+++ b/hw/net/e1000_regs.h
@@ -29,9 +29,8 @@
  * Structures, enums, and macros for the MAC
  */
 
-#ifndef _E1000_HW_H_
-#define _E1000_HW_H_
-
+#ifndef HW_E1000_REGS_H
+#define HW_E1000_REGS_H
 
 /* PCI Device IDs */
 #define E1000_DEV_ID_82542               0x1000
@@ -1248,4 +1247,4 @@ struct e1000_data_desc {
 #define E1000_IOADDR 0x00
 #define E1000_IODATA 0x04
 
-#endif /* _E1000_HW_H_ */
+#endif /* HW_E1000_REGS_H */
diff --git a/hw/pci-bridge/dec.h b/hw/pci-bridge/dec.h
index 17dc0c2..ae17ca7 100644
--- a/hw/pci-bridge/dec.h
+++ b/hw/pci-bridge/dec.h
@@ -1,5 +1,5 @@
-#ifndef DEC_PCI_H
-#define DEC_PCI_H
+#ifndef HW_PCI_BRIDGE_DEC_H
+#define HW_PCI_BRIDGE_DEC_H
 
 #include "qemu-common.h"
 
diff --git a/hw/ppc/ppc405.h b/hw/ppc/ppc405.h
index 1c5f04f..c67febc 100644
--- a/hw/ppc/ppc405.h
+++ b/hw/ppc/ppc405.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#if !defined(PPC_405_H)
-#define PPC_405_H
+#ifndef PPC405_H
+#define PPC405_H
 
 #include "hw/ppc/ppc4xx.h"
 
@@ -78,4 +78,4 @@ CPUPPCState *ppc_stb025_init (MemoryRegion ram_memories[2],
                            uint32_t sysclk, qemu_irq **picp,
                            ram_addr_t *offsetp);
 
-#endif /* !defined(PPC_405_H) */
+#endif /* PPC405_H */
diff --git a/hw/scsi/mfi.h b/hw/scsi/mfi.h
index 29d4177..e67a5c0 100644
--- a/hw/scsi/mfi.h
+++ b/hw/scsi/mfi.h
@@ -30,8 +30,8 @@
  * SUCH DAMAGE.
  */
 
-#ifndef MFI_REG_H
-#define MFI_REG_H
+#ifndef SCSI_MFI_H
+#define SCSI_MFI_H
 
 /*
  * MegaRAID SAS MFI firmware definitions
@@ -1269,4 +1269,4 @@ struct mfi_config_data {
 #define MFI_SCSI_MAX_CMDS       8
 #define MFI_SCSI_MAX_CDB_LEN   16
 
-#endif /* MFI_REG_H */
+#endif /* SCSI_MFI_H */
diff --git a/hw/tpm/tpm_util.h b/hw/tpm/tpm_util.h
index e7f354a..df76245 100644
--- a/hw/tpm/tpm_util.h
+++ b/hw/tpm/tpm_util.h
@@ -18,11 +18,12 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
-#ifndef TPM_TPM_UTILS_H
-#define TPM_TPM_UTILS_H
+
+#ifndef TPM_TPM_UTIL_H
+#define TPM_TPM_UTIL_H
 
 #include "sysemu/tpm_backend.h"
 
 int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version);
 
-#endif /* TPM_TPM_UTILS_H */
+#endif /* TPM_TPM_UTIL_H */
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 3021842..3fd7038 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -14,8 +14,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef HW_USB_EHCI_H
-#define HW_USB_EHCI_H 1
+
+#ifndef HW_USB_HCD_EHCI_H
+#define HW_USB_HCD_EHCI_H
 
 #include "hw/hw.h"
 #include "qemu/timer.h"
diff --git a/include/block/scsi.h b/include/block/scsi.h
index a311341..d938ffc 100644
--- a/include/block/scsi.h
+++ b/include/block/scsi.h
@@ -19,8 +19,9 @@
  * This header file contains public constants and structures used by
  * the scsi code for linux.
  */
-#ifndef HW_SCSI_DEFS_H
-#define HW_SCSI_DEFS_H 1
+
+#ifndef BLOCK_SCSI_H
+#define BLOCK_SCSI_H
 
 /*
  *      SCSI opcodes
diff --git a/include/crypto/desrfb.h b/include/crypto/desrfb.h
index 773667e..7ca596c 100644
--- a/include/crypto/desrfb.h
+++ b/include/crypto/desrfb.h
@@ -9,8 +9,9 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  */
-#ifndef D3DES_H
-#define D3DES_H 1
+
+#ifndef QCRYPTO_DESRFB_H
+#define QCRYPTO_DESRFB_H
 
 /* d3des.h -
  *
diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
index 59e9187..ad47d88 100644
--- a/include/crypto/tlscreds.h
+++ b/include/crypto/tlscreds.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_TLSCRED_H__
-#define QCRYPTO_TLSCRED_H__
+#ifndef QCRYPTO_TLSCREDS_H
+#define QCRYPTO_TLSCREDS_H
 
 #include "qom/object.h"
 
@@ -63,5 +63,4 @@ struct QCryptoTLSCredsClass {
 };
 
 
-#endif /* QCRYPTO_TLSCRED_H__ */
-
+#endif /* QCRYPTO_TLSCREDS_H */
diff --git a/include/crypto/tlscredsanon.h b/include/crypto/tlscredsanon.h
index d3976b8..4d6b7e4 100644
--- a/include/crypto/tlscredsanon.h
+++ b/include/crypto/tlscredsanon.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_TLSCRED_ANON_H__
-#define QCRYPTO_TLSCRED_ANON_H__
+#ifndef QCRYPTO_TLSCREDSANON_H
+#define QCRYPTO_TLSCREDSANON_H
 
 #include "crypto/tlscreds.h"
 
@@ -108,5 +108,4 @@ struct QCryptoTLSCredsAnonClass {
 };
 
 
-#endif /* QCRYPTO_TLSCRED_H__ */
-
+#endif /* QCRYPTO_TLSCREDSANON_H */
diff --git a/include/crypto/tlscredsx509.h b/include/crypto/tlscredsx509.h
index 25796d7..66ad6a7 100644
--- a/include/crypto/tlscredsx509.h
+++ b/include/crypto/tlscredsx509.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_TLSCRED_X509_H__
-#define QCRYPTO_TLSCRED_X509_H__
+#ifndef QCRYPTO_TLSCREDSX509_H
+#define QCRYPTO_TLSCREDSX509_H
 
 #include "crypto/tlscreds.h"
 
@@ -110,5 +110,4 @@ struct QCryptoTLSCredsX509Class {
 };
 
 
-#endif /* QCRYPTO_TLSCRED_X509_H__ */
-
+#endif /* QCRYPTO_TLSCREDSX509_H */
diff --git a/include/crypto/tlssession.h b/include/crypto/tlssession.h
index c1bad9e..1c7414e 100644
--- a/include/crypto/tlssession.h
+++ b/include/crypto/tlssession.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_TLS_SESSION_H__
-#define QCRYPTO_TLS_SESSION_H__
+#ifndef QCRYPTO_TLSSESSION_H
+#define QCRYPTO_TLSSESSION_H
 
 #include "crypto/tlscreds.h"
 
@@ -319,4 +319,4 @@ int qcrypto_tls_session_get_key_size(QCryptoTLSSession *sess,
  */
 char *qcrypto_tls_session_get_peer_name(QCryptoTLSSession *sess);
 
-#endif /* QCRYPTO_TLS_SESSION_H__ */
+#endif /* QCRYPTO_TLSSESSION_H */
diff --git a/include/disas/bfd.h b/include/disas/bfd.h
index a112e9c..5fbff00 100644
--- a/include/disas/bfd.h
+++ b/include/disas/bfd.h
@@ -6,8 +6,8 @@
    interface, for making instruction-processing programs more independent
    of the instruction set being processed.  */
 
-#ifndef DIS_ASM_H
-#define DIS_ASM_H
+#ifndef DISAS_BFD_H
+#define DISAS_BFD_H
 
 #include "qemu-common.h"
 
@@ -489,4 +489,4 @@ bfd_vma bfd_getl16 (const bfd_byte *addr);
 bfd_vma bfd_getb16 (const bfd_byte *addr);
 typedef bool bfd_boolean;
 
-#endif /* ! defined (DIS_ASM_H) */
+#endif /* DISAS_BFD_H */
diff --git a/include/exec/address-spaces.h b/include/exec/address-spaces.h
index 3d12cdd..db8bfa9 100644
--- a/include/exec/address-spaces.h
+++ b/include/exec/address-spaces.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef EXEC_MEMORY_H
-#define EXEC_MEMORY_H
+#ifndef EXEC_ADDRESS_SPACES_H
+#define EXEC_ADDRESS_SPACES_H
 
 /*
  * Internal interfaces between memory.c/exec.c/vl.c.  Do not #include unless
diff --git a/include/exec/helper-head.h b/include/exec/helper-head.h
index 74f8f03..1cfc43b 100644
--- a/include/exec/helper-head.h
+++ b/include/exec/helper-head.h
@@ -15,9 +15,8 @@
     GEN_HELPER 2 to do runtime registration helper functions.
  */
 
-#ifndef DEF_HELPER_H
-#define DEF_HELPER_H 1
-
+#ifndef EXEC_HELPER_HEAD_H
+#define EXEC_HELPER_HEAD_H
 
 #define HELPER(name) glue(helper_, name)
 
@@ -133,4 +132,4 @@
 
 /* MAX_OPC_PARAM_IARGS must be set to n if last entry is DEF_HELPER_FLAGS_n. */
 
-#endif /* DEF_HELPER_H */
+#endif /* EXEC_HELPER_HEAD_H */
diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index 80eedac..a09d6c6 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -1,5 +1,6 @@
-#ifndef QEMU_TYPES_H
-#define QEMU_TYPES_H
+#ifndef EXEC_USER_ABITYPES_H
+#define EXEC_USER_ABITYPES_H
+
 #include "cpu.h"
 
 #ifdef TARGET_ABI32
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index e7a1a4c..e5f0878 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -1,5 +1,5 @@
-#ifndef HW_ACPI_GEN_UTILS_H
-#define HW_ACPI_GEN_UTILS_H
+#ifndef HW_ACPI_AML_BUILD_H
+#define HW_ACPI_AML_BUILD_H
 
 #include "hw/acpi/acpi-defs.h"
 #include "hw/acpi/bios-linker-loader.h"
diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h
index b995ef2..3b932ab 100644
--- a/include/hw/acpi/cpu_hotplug.h
+++ b/include/hw/acpi/cpu_hotplug.h
@@ -9,8 +9,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#ifndef ACPI_HOTPLUG_H
-#define ACPI_HOTPLUG_H
+
+#ifndef HW_ACPI_CPU_HOTPLUG_H
+#define HW_ACPI_CPU_HOTPLUG_H
 
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/pc-hotplug.h"
diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h
index 8b49a98..aeeebfe 100644
--- a/include/hw/arm/arm.h
+++ b/include/hw/arm/arm.h
@@ -8,8 +8,8 @@
  *
  */
 
-#ifndef ARM_MISC_H
-#define ARM_MISC_H 1
+#ifndef HW_ARM_H
+#define HW_ARM_H
 
 #include "exec/memory.h"
 #include "target-arm/cpu-qom.h"
@@ -140,4 +140,4 @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu,
    ticks.  */
 extern int system_clock_scale;
 
-#endif /* !ARM_MISC_H */
+#endif /* HW_ARM_H */
diff --git a/include/hw/arm/stm32f205_soc.h b/include/hw/arm/stm32f205_soc.h
index 0390eff..779b5da 100644
--- a/include/hw/arm/stm32f205_soc.h
+++ b/include/hw/arm/stm32f205_soc.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef HW_ARM_STM32F205SOC_H
-#define HW_ARM_STM32F205SOC_H
+#ifndef HW_ARM_STM32F205_SOC_H
+#define HW_ARM_STM32F205_SOC_H
 
 #include "hw/misc/stm32f2xx_syscfg.h"
 #include "hw/timer/stm32f2xx_timer.h"
diff --git a/include/hw/audio/audio.h b/include/hw/audio/audio.h
index b28abdd..55d40f7 100644
--- a/include/hw/audio/audio.h
+++ b/include/hw/audio/audio.h
@@ -1,5 +1,5 @@
-#ifndef HW_AUDIODEV_H
-#define HW_AUDIODEV_H 1
+#ifndef HW_AUDIO_H
+#define HW_AUDIO_H
 
 void isa_register_soundhw(const char *name, const char *descr,
                           int (*init_isa)(ISABus *bus));
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
index 984660e..87c87ed 100644
--- a/include/hw/block/block.h
+++ b/include/hw/block/block.h
@@ -8,8 +8,8 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
-#ifndef HW_BLOCK_COMMON_H
-#define HW_BLOCK_COMMON_H
+#ifndef HW_BLOCK_H
+#define HW_BLOCK_H
 
 #include "qemu-common.h"
 
diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h
index 93bd7ee..0ca7c19 100644
--- a/include/hw/char/pl011.h
+++ b/include/hw/char/pl011.h
@@ -12,8 +12,8 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef PL011_UART_H
-#define PL011_UART_H
+#ifndef HW_PL011_H
+#define HW_PL011_H
 
 static inline DeviceState *pl011_create(hwaddr addr,
                                         qemu_irq irq,
diff --git a/include/hw/cris/etraxfs.h b/include/hw/cris/etraxfs.h
index eb66418..723a275 100644
--- a/include/hw/cris/etraxfs.h
+++ b/include/hw/cris/etraxfs.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef HW_EXTRAXFS_H
-#define HW_EXTRAXFS_H 1
+#ifndef HW_ETRAXFS_H
+#define HW_ETRAXFS_H
 
 #include "net/net.h"
 #include "hw/cris/etraxfs_dma.h"
diff --git a/include/hw/intc/allwinner-a10-pic.h b/include/hw/intc/allwinner-a10-pic.h
index 5721b2e..1d314a7 100644
--- a/include/hw/intc/allwinner-a10-pic.h
+++ b/include/hw/intc/allwinner-a10-pic.h
@@ -1,5 +1,5 @@
-#ifndef AW_A10_PIC_H
-#define AW_A10_PIC_H
+#ifndef ALLWINNER_A10_PIC_H
+#define ALLWINNER_A10_PIC_H
 
 #define TYPE_AW_A10_PIC  "allwinner-a10-pic"
 #define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC)
diff --git a/include/hw/misc/arm_integrator_debug.h b/include/hw/misc/arm_integrator_debug.h
index 37789b6..0077dac 100644
--- a/include/hw/misc/arm_integrator_debug.h
+++ b/include/hw/misc/arm_integrator_debug.h
@@ -10,8 +10,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#ifndef QEMU_INTEGRATOR_DEBUG_H
-#define QEMU_INTEGRATOR_DEBUG_H
+
+#ifndef ARM_INTEGRATOR_DEBUG_H
+#define ARM_INTEGRATOR_DEBUG_H
 
 #define TYPE_INTEGRATOR_DEBUG "integrator_debug"
 
diff --git a/include/hw/misc/auxbus.h b/include/hw/misc/auxbus.h
index af39db7..68ade8a 100644
--- a/include/hw/misc/auxbus.h
+++ b/include/hw/misc/auxbus.h
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef QEMU_AUX_H
-#define QEMU_AUX_H
+#ifndef HW_MISC_AUXBUS_H
+#define HW_MISC_AUXBUS_H
 
 #include "hw/qdev.h"
 
@@ -125,4 +125,4 @@ void aux_init_mmio(AUXSlave *aux_slave, MemoryRegion *mmio);
 
 DeviceState *aux_create_slave(AUXBus *bus, const char *name, uint32_t addr);
 
-#endif /* !QEMU_AUX_H */
+#endif /* HW_MISC_AUXBUS_H */
diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h
index 690e1d6..a209d91 100644
--- a/include/hw/misc/mips_cmgcr.h
+++ b/include/hw/misc/mips_cmgcr.h
@@ -7,8 +7,8 @@
  *
  */
 
-#ifndef _MIPS_GCR_H
-#define _MIPS_GCR_H
+#ifndef MIPS_CMGCR_H
+#define MIPS_CMGCR_H
 
 #define TYPE_MIPS_GCR "mips-gcr"
 #define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
@@ -83,4 +83,4 @@ struct MIPSGCRState {
     MIPSGCRVPState *vps;
 };
 
-#endif /* _MIPS_GCR_H */
+#endif /* MIPS_CMGCR_H */
diff --git a/include/hw/misc/tmp105_regs.h b/include/hw/misc/tmp105_regs.h
index 9b55aba..ef015ee 100644
--- a/include/hw/misc/tmp105_regs.h
+++ b/include/hw/misc/tmp105_regs.h
@@ -11,8 +11,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or
  * later. See the COPYING file in the top-level directory.
  */
-#ifndef QEMU_TMP105_MSGS_H
-#define QEMU_TMP105_MSGS_H
+
+#ifndef TMP105_REGS_H
+#define TMP105_REGS_H
 
 /**
  * TMP105Reg:
diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h
index 9f21aa7..4cc8aab 100644
--- a/include/hw/net/allwinner_emac.h
+++ b/include/hw/net/allwinner_emac.h
@@ -19,8 +19,9 @@
  * GNU General Public License for more details.
  *
  */
-#ifndef AW_EMAC_H
-#define AW_EMAC_H
+
+#ifndef ALLWINNER_EMAC_H
+#define ALLWINNER_EMAC_H
 
 #include "net/net.h"
 #include "qemu/fifo8.h"
diff --git a/include/hw/nvram/openbios_firmware_abi.h b/include/hw/nvram/openbios_firmware_abi.h
index c66ee22..74cfd56 100644
--- a/include/hw/nvram/openbios_firmware_abi.h
+++ b/include/hw/nvram/openbios_firmware_abi.h
@@ -1,5 +1,5 @@
-#ifndef FIRMWARE_ABI_H
-#define FIRMWARE_ABI_H
+#ifndef OPENBIOS_FIRMWARE_ABI_H
+#define OPENBIOS_FIRMWARE_ABI_H
 
 /* OpenBIOS NVRAM partition */
 struct OpenBIOS_nvpart_v1 {
@@ -72,4 +72,4 @@ Sun_init_header(struct Sun_nvram *header, const uint8_t *macaddr, int machine_id
 
     header->checksum = tmp;
 }
-#endif /* FIRMWARE_ABI_H */
+#endif /* OPENBIOS_FIRMWARE_ABI_H */
diff --git a/include/hw/pci-host/apb.h b/include/hw/pci-host/apb.h
index 736db61..b19bd55 100644
--- a/include/hw/pci-host/apb.h
+++ b/include/hw/pci-host/apb.h
@@ -1,5 +1,5 @@
-#ifndef APB_PCI_H
-#define APB_PCI_H
+#ifndef PCI_HOST_APB_H
+#define PCI_HOST_APB_H
 
 #include "qemu-common.h"
 
diff --git a/include/hw/pci-host/ppce500.h b/include/hw/pci-host/ppce500.h
index 61f773e..e3a3742 100644
--- a/include/hw/pci-host/ppce500.h
+++ b/include/hw/pci-host/ppce500.h
@@ -1,5 +1,5 @@
-#ifndef PPCE500_PCI_H
-#define PPCE500_PCI_H
+#ifndef PCI_HOST_PPCE500_H
+#define PCI_HOST_PPCE500_H
 
 static inline int ppce500_pci_map_irq_slot(int devno, int irq_num)
 {
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 7b63243..5adc603 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#if !defined(__HW_SPAPR_PCI_H__)
-#define __HW_SPAPR_PCI_H__
+#ifndef PCI_HOST_SPAPR_H
+#define PCI_HOST_SPAPR_H
 
 #include "hw/ppc/spapr.h"
 #include "hw/pci/pci.h"
@@ -153,4 +153,4 @@ static inline void spapr_phb_vfio_reset(DeviceState *qdev)
 
 void spapr_phb_dma_reset(sPAPRPHBState *sphb);
 
-#endif /* __HW_SPAPR_PCI_H__ */
+#endif /* PCI_HOST_SPAPR_H */
diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h
index 91d84ba..3b01ae8 100644
--- a/include/hw/ppc/ppc4xx.h
+++ b/include/hw/ppc/ppc4xx.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#if !defined(PPC_4XX_H)
-#define PPC_4XX_H
+#ifndef PPC4XX_H
+#define PPC4XX_H
 
 #include "hw/pci/pci.h"
 
@@ -61,4 +61,4 @@ PCIBus *ppc4xx_pci_init(CPUPPCState *env, qemu_irq pci_irqs[4],
                         hwaddr special_cycle,
                         hwaddr registers);
 
-#endif /* !defined(PPC_4XX_H) */
+#endif /* PPC4XX_H */
diff --git a/include/hw/s390x/ioinst.h b/include/hw/s390x/ioinst.h
index 12d44c8..c559f53 100644
--- a/include/hw/s390x/ioinst.h
+++ b/include/hw/s390x/ioinst.h
@@ -9,8 +9,8 @@
  * directory.
 */
 
-#ifndef IOINST_S390X_H
-#define IOINST_S390X_H
+#ifndef S390X_IOINST_H
+#define S390X_IOINST_H
 
 /*
  * Channel I/O related definitions, as defined in the Principles
diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h
index dbb9eef..06aa096 100644
--- a/include/hw/ssi/xilinx_spips.h
+++ b/include/hw/ssi/xilinx_spips.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef XLNX_SPIPS_H
-#define XLNX_SPIPS_H
+#ifndef XILINX_SPIPS_H
+#define XILINX_SPIPS_H
 
 #include "hw/ssi/ssi.h"
 #include "qemu/fifo8.h"
@@ -69,4 +69,4 @@ struct XilinxSPIPS {
 #define XILINX_QSPIPS(obj) \
      OBJECT_CHECK(XilinxQSPIPS, (obj), TYPE_XILINX_QSPIPS)
 
-#endif /* XLNX_SPIPS_H */
+#endif /* XILINX_SPIPS_H */
diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h
index 98d8e0a..81c4388 100644
--- a/include/hw/timer/a9gtimer.h
+++ b/include/hw/timer/a9gtimer.h
@@ -20,8 +20,8 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef HW_TIMER_A9_GTIMER_H_H
-#define HW_TIMER_A9_GTIMER_H_H
+#ifndef A9GTIMER_H
+#define A9GTIMER_H
 
 #include "hw/sysbus.h"
 
@@ -94,4 +94,4 @@ typedef struct A9GTimerUpdate {
     uint64_t new;
 } A9GTimerUpdate;
 
-#endif /* #ifdef HW_TIMER_A9_GTIMER_H_H */
+#endif /* A9GTIMER_H */
diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwinner-a10-pit.h
index 770bdc0..c0cc3e2 100644
--- a/include/hw/timer/allwinner-a10-pit.h
+++ b/include/hw/timer/allwinner-a10-pit.h
@@ -1,5 +1,5 @@
-#ifndef AW_A10_PIT_H
-#define AW_A10_PIT_H
+#ifndef ALLWINNER_A10_PIT_H
+#define ALLWINNER_A10_PIT_H
 
 #include "hw/ptimer.h"
 
diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h
index f38bcfe..f04c4d3 100644
--- a/include/hw/timer/hpet.h
+++ b/include/hw/timer/hpet.h
@@ -10,8 +10,9 @@
  * the COPYING file in the top-level directory.
  *
  */
-#ifndef QEMU_HPET_EMUL_H
-#define QEMU_HPET_EMUL_H
+
+#ifndef HW_HPET_H
+#define HW_HPET_H
 
 #include "qom/object.h"
 
diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
index 3367923..db5e43a 100644
--- a/include/hw/timer/m48t59.h
+++ b/include/hw/timer/m48t59.h
@@ -1,5 +1,5 @@
-#ifndef NVRAM_H
-#define NVRAM_H
+#ifndef HW_M48T59_H
+#define HW_M48T59_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
@@ -31,4 +31,4 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
                    uint32_t io_base, uint16_t size, int base_year,
                    int type);
 
-#endif /* !NVRAM_H */
+#endif /* HW_M48T59_H */
diff --git a/include/hw/timer/mc146818rtc_regs.h b/include/hw/timer/mc146818rtc_regs.h
index ccdee42..6ede6c8 100644
--- a/include/hw/timer/mc146818rtc_regs.h
+++ b/include/hw/timer/mc146818rtc_regs.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef RTC_REGS_H
-#define RTC_REGS_H
+
+#ifndef MC146818RTC_REGS_H
+#define MC146818RTC_REGS_H
 
 #define RTC_ISA_IRQ 8
 
diff --git a/include/hw/tricore/tricore.h b/include/hw/tricore/tricore.h
index 5f13252..89ef922 100644
--- a/include/hw/tricore/tricore.h
+++ b/include/hw/tricore/tricore.h
@@ -1,5 +1,5 @@
-#ifndef TRICORE_MISC_H
-#define TRICORE_MISC_H 1
+#ifndef HW_TRICORE_H
+#define HW_TRICORE_H
 
 #include "exec/memory.h"
 #include "hw/irq.h"
diff --git a/include/hw/vfio/vfio.h b/include/hw/vfio/vfio.h
index f27d599..86248f5 100644
--- a/include/hw/vfio/vfio.h
+++ b/include/hw/vfio/vfio.h
@@ -1,5 +1,5 @@
-#ifndef VFIO_API_H
-#define VFIO_API_H
+#ifndef HW_VFIO_H
+#define HW_VFIO_H
 
 bool vfio_eeh_as_ok(AddressSpace *as);
 int vfio_eeh_as_op(AddressSpace *as, uint32_t op);
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 3dff0c9..325354f 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -11,8 +11,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef _QEMU_VIRTIO_VGA_H
-#define _QEMU_VIRTIO_VGA_H
+#ifndef HW_VIRTIO_GPU_H
+#define HW_VIRTIO_GPU_H
 
 #include "qemu/queue.h"
 #include "ui/qemu-pixman.h"
diff --git a/include/libdecnumber/decNumberLocal.h b/include/libdecnumber/decNumberLocal.h
index 94fb512..c4d4015 100644
--- a/include/libdecnumber/decNumberLocal.h
+++ b/include/libdecnumber/decNumberLocal.h
@@ -37,8 +37,9 @@
 /* decNumber.h or one of decDouble (etc.) must be included first.     */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECNUMBERLOC)
-  #define DECNUMBERLOC
+#ifndef DECNUMBERLOCAL_H
+#define DECNUMBERLOCAL_H
+
   #define DECVERSION	"decNumber 3.53" /* Package Version [16 max.] */
   #define DECNLAUTHOR	"Mike Cowlishaw"	      /* Who to blame */
 
diff --git a/include/migration/block.h b/include/migration/block.h
index ffa8ac0..41a1ac8 100644
--- a/include/migration/block.h
+++ b/include/migration/block.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef BLOCK_MIGRATION_H
-#define BLOCK_MIGRATION_H
+#ifndef MIGRATION_BLOCK_H
+#define MIGRATION_BLOCK_H
 
 void blk_mig_init(void);
 int blk_mig_active(void);
@@ -20,4 +20,4 @@ uint64_t blk_mig_bytes_transferred(void);
 uint64_t blk_mig_bytes_remaining(void);
 uint64_t blk_mig_bytes_total(void);
 
-#endif /* BLOCK_MIGRATION_H */
+#endif /* MIGRATION_BLOCK_H */
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index bc2c9c0..454e8ed 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef MONITOR_COMMON_H
-#define MONITOR_COMMON_H
+
+#ifndef MONITOR_HMP_TARGET_H
+#define MONITOR_HMP_TARGET_H
 
 #define MD_TLONG 0
 #define MD_I32   1
@@ -46,4 +47,4 @@ void hmp_mce(Monitor *mon, const QDict *qdict);
 void hmp_info_local_apic(Monitor *mon, const QDict *qdict);
 void hmp_info_io_apic(Monitor *mon, const QDict *qdict);
 
-#endif /* MONITOR_COMMON */
+#endif /* MONITOR_HMP_TARGET_H */
diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h
index c4b8a05..8e504bc 100644
--- a/include/monitor/qdev.h
+++ b/include/monitor/qdev.h
@@ -1,5 +1,5 @@
-#ifndef QEMU_QDEV_MONITOR_H
-#define QEMU_QDEV_MONITOR_H
+#ifndef MONITOR_QDEV_H
+#define MONITOR_QDEV_H
 
 #include "hw/qdev-core.h"
 
diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h
index 5609946..48c11b6 100644
--- a/include/qapi/qmp/dispatch.h
+++ b/include/qapi/qmp/dispatch.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef QMP_CORE_H
-#define QMP_CORE_H
+#ifndef QAPI_QMP_DISPATCH_H
+#define QAPI_QMP_DISPATCH_H
 
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qdict.h"
@@ -48,4 +48,3 @@ typedef void (*qmp_cmd_callback_fn)(QmpCommand *cmd, void *opaque);
 void qmp_for_each_command(qmp_cmd_callback_fn fn, void *opaque);
 
 #endif
-
diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h
index f21ecf4..27cfbd8 100644
--- a/include/qapi/qmp/types.h
+++ b/include/qapi/qmp/types.h
@@ -10,8 +10,8 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
-#ifndef QEMU_OBJECTS_H
-#define QEMU_OBJECTS_H
+#ifndef QAPI_QMP_TYPES_H
+#define QAPI_QMP_TYPES_H
 
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qint.h"
@@ -21,4 +21,4 @@
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
 
-#endif /* QEMU_OBJECTS_H */
+#endif /* QAPI_QMP_TYPES_H */
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index fb8f4eb..6c77a91 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -11,8 +11,9 @@
  * See the COPYING.LIB file in the top-level directory.
  *
  */
-#ifndef QAPI_VISITOR_CORE_H
-#define QAPI_VISITOR_CORE_H
+
+#ifndef QAPI_VISITOR_H
+#define QAPI_VISITOR_H
 
 #include "qapi/qmp/qobject.h"
 
diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h
index 8603e86..8d4b2b6 100644
--- a/include/qemu/config-file.h
+++ b/include/qemu/config-file.h
@@ -1,5 +1,5 @@
-#ifndef QEMU_CONFIG_H
-#define QEMU_CONFIG_H
+#ifndef QEMU_CONFIG_FILE_H
+#define QEMU_CONFIG_FILE_H
 
 #include "qemu/option.h"
 #include "qapi/qmp/qdict.h"
@@ -27,4 +27,4 @@ void qemu_config_parse_qdict(QDict *options, QemuOptsList **lists,
  */
 int qemu_read_default_config_files(bool userconfig);
 
-#endif /* QEMU_CONFIG_H */
+#endif /* QEMU_CONFIG_FILE_H */
diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
index 7a2a363..499ec8b 100644
--- a/include/qemu/error-report.h
+++ b/include/qemu/error-report.h
@@ -10,9 +10,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef QEMU_ERROR_H
-#define QEMU_ERROR_H
-
+#ifndef QEMU_ERROR_REPORT_H
+#define QEMU_ERROR_REPORT_H
 
 typedef struct Location {
     /* all members are private to qemu-error.c */
diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h
index 8820780..24b3644 100644
--- a/include/qemu/fifo8.h
+++ b/include/qemu/fifo8.h
@@ -1,5 +1,5 @@
-#ifndef FIFO_H
-#define FIFO_H
+#ifndef QEMU_FIFO8_H
+#define QEMU_FIFO8_H
 
 #include "migration/vmstate.h"
 
@@ -157,4 +157,4 @@ extern const VMStateDescription vmstate_fifo8;
     .offset     = vmstate_offset_value(_state, _field, Fifo8),       \
 }
 
-#endif /* FIFO_H */
+#endif /* QEMU_FIFO8_H */
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 8542d2d..1f9e3f9 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -23,8 +23,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef QEMU_OPTIONS_H
-#define QEMU_OPTIONS_H
+#ifndef QEMU_OPTION_H
+#define QEMU_OPTION_H
 
 #include "qemu/queue.h"
 #include "qapi/qmp/qdict.h"
diff --git a/include/qemu/option_int.h b/include/qemu/option_int.h
index 6432c1a..26b1d9e 100644
--- a/include/qemu/option_int.h
+++ b/include/qemu/option_int.h
@@ -23,8 +23,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef QEMU_OPTIONS_INTERNAL_H
-#define QEMU_OPTIONS_INTERNAL_H
+#ifndef QEMU_OPTION_INT_H
+#define QEMU_OPTION_INT_H
 
 #include "qemu/option.h"
 #include "qemu/error-report.h"
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 2f3763f..5fe01fb 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -1,6 +1,7 @@
 /* headers to use the BSD sockets */
-#ifndef QEMU_SOCKET_H
-#define QEMU_SOCKET_H
+
+#ifndef QEMU_SOCKETS_H
+#define QEMU_SOCKETS_H
 
 #ifdef _WIN32
 
@@ -121,4 +122,5 @@ SocketAddress *socket_remote_address(int fd, Error **errp);
  * Returns: the socket address in string format, or NULL on error
  */
 char *socket_address_to_string(struct SocketAddress *addr, Error **errp);
-#endif /* QEMU_SOCKET_H */
+
+#endif /* QEMU_SOCKETS_H */
diff --git a/include/sysemu/bt.h b/include/sysemu/bt.h
index 2bc6d53..ddb05cd 100644
--- a/include/sysemu/bt.h
+++ b/include/sysemu/bt.h
@@ -1,5 +1,5 @@
-#ifndef BT_HOST_H
-#define BT_HOST_H
+#ifndef SYSEMU_BT_H
+#define SYSEMU_BT_H
 
 /* BT HCI info */
 
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index 4d6617e..9bc2e70 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -9,8 +9,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#ifndef QEMU_RAM_H
-#define QEMU_RAM_H
+
+#ifndef SYSEMU_HOSTMEM_H
+#define SYSEMU_HOSTMEM_H
 
 #include "sysemu/sysemu.h" /* for MAX_NODES */
 #include "qom/object.h"
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index e3ec800..b58f52d 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -10,8 +10,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef _QEMU_TPM_H
-#define _QEMU_TPM_H
+#ifndef TPM_BACKEND_H
+#define TPM_BACKEND_H
 
 #include "qom/object.h"
 #include "qemu-common.h"
diff --git a/include/sysemu/tpm_backend_int.h b/include/sysemu/tpm_backend_int.h
index cc0dcb3..00639dd 100644
--- a/include/sysemu/tpm_backend_int.h
+++ b/include/sysemu/tpm_backend_int.h
@@ -19,9 +19,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
 
-#ifndef TPM_TPM_BACKEND_H
-#define TPM_TPM_BACKEND_H
-
+#ifndef TPM_BACKEND_INT_H
+#define TPM_BACKEND_INT_H
 
 typedef struct TPMBackendThread {
     GThreadPool *pool;
@@ -39,4 +38,4 @@ typedef enum TPMBackendCmd {
     TPM_BACKEND_CMD_TPM_RESET,
 } TPMBackendCmd;
 
-#endif /* TPM_TPM_BACKEND_H */
+#endif /* TPM_BACKEND_INT_H */
diff --git a/net/tap_int.h b/net/tap_int.h
index 2378021..ae6888f 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -23,8 +23,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef QEMU_TAP_H
-#define QEMU_TAP_H
+#ifndef NET_TAP_INT_H
+#define NET_TAP_INT_H
 
 #include "qemu-common.h"
 #include "qapi-types.h"
@@ -46,4 +46,4 @@ int tap_fd_enable(int fd);
 int tap_fd_disable(int fd);
 int tap_fd_get_ifname(int fd, char *ifname);
 
-#endif /* QEMU_TAP_H */
+#endif /* NET_TAP_INT_H */
diff --git a/qga/service-win32.h b/qga/service-win32.h
index 3b9e870..89e99df 100644
--- a/qga/service-win32.h
+++ b/qga/service-win32.h
@@ -10,8 +10,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#ifndef QGA_SERVICE_H
-#define QGA_SERVICE_H
+
+#ifndef QGA_SERVICE_WIN32_H
+#define QGA_SERVICE_WIN32_H
 
 #include <windows.h>
 
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index 1ffde0f..c81a856 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -10,8 +10,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef VSS_WIN32_H
-#define VSS_WIN32_H
+#ifndef VSS_COMMON_H
+#define VSS_COMMON_H
 
 #define __MIDL_user_allocate_free_DEFINED__
 #include <windows.h>
diff --git a/slirp/ip6_icmp.h b/slirp/ip6_icmp.h
index 2282d29..b3378b1 100644
--- a/slirp/ip6_icmp.h
+++ b/slirp/ip6_icmp.h
@@ -3,8 +3,8 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#ifndef SLIRP_NETINET_ICMP6_H_
-#define SLIRP_NETINET_ICMP6_H_
+#ifndef SLIRP_IP6_ICMP_H
+#define SLIRP_IP6_ICMP_H
 
 /*
  * Interface Control Message Protocol version 6 Definitions.
diff --git a/slirp/slirp.h b/slirp/slirp.h
index e3641f9..624a850 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -1,5 +1,5 @@
-#ifndef __COMMON_H__
-#define __COMMON_H__
+#ifndef SLIRP_H
+#define SLIRP_H
 
 #include "qemu/host-utils.h"
 #include "slirp_config.h"
diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
index b26201f..0c3b562 100644
--- a/target-i386/hyperv.h
+++ b/target-i386/hyperv.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef HYPERV_I386_H
-#define HYPERV_I386_H
+#ifndef TARGET_I386_HYPERV_H
+#define TARGET_I386_HYPERV_H
 
 #include "cpu.h"
 #include "sysemu/kvm.h"
diff --git a/target-openrisc/exception.h b/target-openrisc/exception.h
index 4b64430..4ec56b4 100644
--- a/target-openrisc/exception.h
+++ b/target-openrisc/exception.h
@@ -17,12 +17,12 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef QEMU_OPENRISC_EXCP_H
-#define QEMU_OPENRISC_EXCP_H
+#ifndef TARGET_OPENRISC_EXCEPTION_H
+#define TARGET_OPENRISC_EXCEPTION_H
 
 #include "cpu.h"
 #include "qemu-common.h"
 
 void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
 
-#endif /* QEMU_OPENRISC_EXCP_H */
+#endif /* TARGET_OPENRISC_EXCEPTION_H */
diff --git a/target-tilegx/opcode_tilegx.h b/target-tilegx/opcode_tilegx.h
index 989436d..55376be 100644
--- a/target-tilegx/opcode_tilegx.h
+++ b/target-tilegx/opcode_tilegx.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef __ARCH_OPCODE_H__
-#define __ARCH_OPCODE_H__
+#ifndef OPCODE_TILEGX_H
+#define OPCODE_TILEGX_H
 
 #ifndef __ASSEMBLER__
 
@@ -1403,4 +1403,4 @@ enum
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* __ARCH_OPCODE_H__ */
+#endif /* OPCODE_TILEGX_H */
diff --git a/target-xtensa/core-dc232b/core-isa.h b/target-xtensa/core-dc232b/core-isa.h
index 69f1065..a9935b8 100644
--- a/target-xtensa/core-dc232b/core-isa.h
+++ b/target-xtensa/core-dc232b/core-isa.h
@@ -8,9 +8,8 @@
  * Copyright (c) 1999-2007 Tensilica Inc.
  */
 
-#ifndef _XTENSA_CORE_CONFIGURATION_H
-#define _XTENSA_CORE_CONFIGURATION_H
-
+#ifndef XTENSA_DC232B_CORE_ISA_H
+#define XTENSA_DC232B_CORE_ISA_H
 
 /****************************************************************************
             Parameters Useful for Any Code, USER or PRIVILEGED
@@ -420,4 +419,4 @@
 #endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
 
 
-#endif /* _XTENSA_CORE_CONFIGURATION_H */
+#endif /* XTENSA_DC232B_CORE_ISA_H */
diff --git a/target-xtensa/core-dc233c/core-isa.h b/target-xtensa/core-dc233c/core-isa.h
index e82c3cb..ff92b7f 100644
--- a/target-xtensa/core-dc233c/core-isa.h
+++ b/target-xtensa/core-dc233c/core-isa.h
@@ -28,9 +28,8 @@
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
-#ifndef _XTENSA_CORE_CONFIGURATION_H
-#define _XTENSA_CORE_CONFIGURATION_H
-
+#ifndef XTENSA_DC233C_CORE_ISA_H
+#define XTENSA_DC233C_CORE_ISA_H
 
 /****************************************************************************
             Parameters Useful for Any Code, USER or PRIVILEGED
@@ -471,4 +470,4 @@ usable for an MMU-based OS */
 #endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
 
 
-#endif /* _XTENSA_CORE_CONFIGURATION_H */
+#endif /* XTENSA_DC233C_CORE_ISA_H */
diff --git a/target-xtensa/core-fsf/core-isa.h b/target-xtensa/core-fsf/core-isa.h
index b519d6c..fb2bb8f 100644
--- a/target-xtensa/core-fsf/core-isa.h
+++ b/target-xtensa/core-fsf/core-isa.h
@@ -8,9 +8,8 @@
  * Copyright (C) 1999-2006 Tensilica Inc.
  */
 
-#ifndef _XTENSA_CORE_H
-#define _XTENSA_CORE_H
-
+#ifndef XTENSA_FSF_CORE_ISA_H
+#define XTENSA_FSF_CORE_ISA_H
 
 /****************************************************************************
             Parameters Useful for Any Code, USER or PRIVILEGED
@@ -358,4 +357,4 @@
 #endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
 
 
-#endif /* _XTENSA_CORE_CONFIGURATION_H */
+#endif /* XTENSA_FSF_CORE_ISA_H */
diff --git a/ui/vnc-enc-tight.h b/ui/vnc-enc-tight.h
index a3add78..95c3dac 100644
--- a/ui/vnc-enc-tight.h
+++ b/ui/vnc-enc-tight.h
@@ -27,8 +27,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef VNC_ENCODING_TIGHT_H
-#define VNC_ENCODING_TIGHT_H
+#ifndef VNC_ENC_TIGHT_H
+#define VNC_ENC_TIGHT_H
 
 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  * Tight Encoding.
@@ -180,4 +180,4 @@
 #define VNC_TIGHT_DETECT_MIN_WIDTH           8
 #define VNC_TIGHT_DETECT_MIN_HEIGHT          8
 
-#endif /* VNC_ENCODING_TIGHT_H */
+#endif /* VNC_ENC_TIGHT_H */
diff --git a/ui/vnc-enc-zrle.h b/ui/vnc-enc-zrle.h
index 6b18213..6535cb2 100644
--- a/ui/vnc-enc-zrle.h
+++ b/ui/vnc-enc-zrle.h
@@ -26,8 +26,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef VNC_ENCODING_ZRLE_H
-#define VNC_ENCODING_ZRLE_H
+#ifndef VNC_ENC_ZRLE_H
+#define VNC_ENC_ZRLE_H
 
 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  * ZRLE - encoding combining Zlib compression, tiling, palettisation and
diff --git a/ui/vnc-enc-zywrle.h b/ui/vnc-enc-zywrle.h
index d436d58..610bd79 100644
--- a/ui/vnc-enc-zywrle.h
+++ b/ui/vnc-enc-zywrle.h
@@ -41,8 +41,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ********************************************************************/
 
-#ifndef VNC_ENCODING_ZYWRLE_H
-#define VNC_ENCODING_ZYWRLE_H
+#ifndef VNC_ENC_ZYWRLE_H
+#define VNC_ENC_ZYWRLE_H
 
 /* Tables for Coefficients filtering. */
 #ifndef ZYWRLE_QUANTIZE
-- 
2.5.5

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

* [Qemu-devel] [PULL 14/18] libdecnumber: Don't fool around with guards to avoid #include
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (12 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 13/18] Clean up header guards that don't match their file name Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 15/18] libdecnumber: Don't error out on decNumberLocal.h re-inclusion Markus Armbruster
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Some libdecnumber headers avoid including decNumber.h or decContext.h
again by checking their header guards.  Don't.  Including them
multiple times is safe, and the compiler can do it efficiently.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 include/libdecnumber/decNumber.h      | 4 +---
 include/libdecnumber/dpd/decimal128.h | 4 +---
 include/libdecnumber/dpd/decimal32.h  | 4 +---
 include/libdecnumber/dpd/decimal64.h  | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/include/libdecnumber/decNumber.h b/include/libdecnumber/decNumber.h
index 9fa4e6a..3f3a74a 100644
--- a/include/libdecnumber/decNumber.h
+++ b/include/libdecnumber/decNumber.h
@@ -38,9 +38,7 @@
   #define DECFULLNAME "Decimal Number Module"	      /* Verbose name */
   #define DECAUTHOR   "Mike Cowlishaw"		      /* Who to blame */
 
-  #if !defined(DECCONTEXT)
-    #include "libdecnumber/decContext.h"
-  #endif
+  #include "libdecnumber/decContext.h"
 
   /* Bit settings for decNumber.bits				      */
   #define DECNEG    0x80      /* Sign; 1=negative, 0=positive or zero */
diff --git a/include/libdecnumber/dpd/decimal128.h b/include/libdecnumber/dpd/decimal128.h
index 7d9ee24..13d1ae8 100644
--- a/include/libdecnumber/dpd/decimal128.h
+++ b/include/libdecnumber/dpd/decimal128.h
@@ -59,9 +59,7 @@
   #ifndef DECNUMDIGITS
     #define DECNUMDIGITS DECIMAL128_Pmax /* size if not already defined*/
   #endif
-  #ifndef DECNUMBER
-    #include "libdecnumber/decNumber.h"
-  #endif
+  #include "libdecnumber/decNumber.h"
 
   /* Decimal 128-bit type, accessible by bytes			      */
   typedef struct {
diff --git a/include/libdecnumber/dpd/decimal32.h b/include/libdecnumber/dpd/decimal32.h
index de313e0..03c80db 100644
--- a/include/libdecnumber/dpd/decimal32.h
+++ b/include/libdecnumber/dpd/decimal32.h
@@ -59,9 +59,7 @@
   #ifndef DECNUMDIGITS
     #define DECNUMDIGITS DECIMAL32_Pmax /* size if not already defined*/
   #endif
-  #ifndef DECNUMBER
-    #include "libdecnumber/decNumber.h"
-  #endif
+  #include "libdecnumber/decNumber.h"
 
   /* Decimal 32-bit type, accessible by bytes */
   typedef struct {
diff --git a/include/libdecnumber/dpd/decimal64.h b/include/libdecnumber/dpd/decimal64.h
index 2f6c049..a375faf 100644
--- a/include/libdecnumber/dpd/decimal64.h
+++ b/include/libdecnumber/dpd/decimal64.h
@@ -61,9 +61,7 @@
   #ifndef DECNUMDIGITS
     #define DECNUMDIGITS DECIMAL64_Pmax /* size if not already defined*/
   #endif
-  #ifndef DECNUMBER
-    #include "libdecnumber/decNumber.h"
-  #endif
+  #include "libdecnumber/decNumber.h"
 
   /* Decimal 64-bit type, accessible by bytes			      */
   typedef struct {
-- 
2.5.5

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

* [Qemu-devel] [PULL 15/18] libdecnumber: Don't error out on decNumberLocal.h re-inclusion
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (13 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 14/18] libdecnumber: Don't fool around with guards to avoid #include Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 16/18] Clean up ill-advised or unusual header guards Markus Armbruster
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

decNumberLocal.h errors out when it's included with its header guard
defined.  This catches multiple inclusions.

Drop that.  Including it multiple times is safe, and the compiler can
do it efficiently.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 include/libdecnumber/decNumberLocal.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/libdecnumber/decNumberLocal.h b/include/libdecnumber/decNumberLocal.h
index c4d4015..12cf1d8 100644
--- a/include/libdecnumber/decNumberLocal.h
+++ b/include/libdecnumber/decNumberLocal.h
@@ -659,6 +659,4 @@
   /* [end of format-dependent macros and constants]		      */
   #endif
 
-#else
-  #error decNumberLocal included more than once
 #endif
-- 
2.5.5

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

* [Qemu-devel] [PULL 16/18] Clean up ill-advised or unusual header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (14 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 15/18] libdecnumber: Don't error out on decNumberLocal.h re-inclusion Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 17/18] Clean up decorations and whitespace around " Markus Armbruster
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Cleaned up with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 contrib/ivshmem-client/ivshmem-client.h | 6 +++---
 contrib/ivshmem-server/ivshmem-server.h | 6 +++---
 crypto/block-luks.h                     | 6 +++---
 crypto/block-qcow.h                     | 6 +++---
 fsdev/9p-iov-marshal.h                  | 4 ++--
 fsdev/9p-marshal.h                      | 4 ++--
 hw/9pfs/9p-proxy.h                      | 5 +++--
 hw/9pfs/9p-xattr.h                      | 5 +++--
 hw/9pfs/9p.h                            | 4 ++--
 hw/9pfs/coth.h                          | 4 ++--
 hw/9pfs/virtio-9p.h                     | 4 ++--
 hw/arm/strongarm.h                      | 4 ++--
 hw/audio/fmopl.h                        | 4 ++--
 hw/block/xen_blkif.h                    | 6 +++---
 hw/core/uboot_image.h                   | 6 +++---
 hw/display/vga.h                        | 6 +++---
 hw/microblaze/boot.h                    | 6 +++---
 hw/net/fsl_etsec/etsec.h                | 7 ++++---
 hw/net/fsl_etsec/registers.h            | 6 +++---
 hw/net/rocker/rocker.h                  | 6 +++---
 hw/net/rocker/rocker_desc.h             | 5 ++---
 hw/net/rocker/rocker_fp.h               | 6 +++---
 hw/net/rocker/rocker_hw.h               | 6 +++---
 hw/net/rocker/rocker_of_dpa.h           | 6 +++---
 hw/net/rocker/rocker_tlv.h              | 4 ++--
 hw/net/rocker/rocker_world.h            | 6 +++---
 hw/net/vmxnet3.h                        | 4 ++--
 hw/net/vmxnet_debug.h                   | 6 +++---
 hw/ppc/mac.h                            | 7 ++++---
 hw/sh4/sh7750_regnames.h                | 6 +++---
 hw/sh4/sh7750_regs.h                    | 4 ++--
 hw/xtensa/bootparam.h                   | 4 ++--
 include/crypto/afsplit.h                | 6 +++---
 include/crypto/block.h                  | 6 +++---
 include/crypto/cipher.h                 | 6 +++---
 include/crypto/hash.h                   | 6 +++---
 include/crypto/init.h                   | 6 +++---
 include/crypto/ivgen.h                  | 6 +++---
 include/crypto/pbkdf.h                  | 6 +++---
 include/crypto/random.h                 | 6 +++---
 include/crypto/secret.h                 | 6 +++---
 include/crypto/xts.h                    | 7 +++----
 include/disas/disas.h                   | 6 +++---
 include/elf.h                           | 7 +++----
 include/exec/exec-all.h                 | 4 ++--
 include/exec/tb-context.h               | 4 ++--
 include/exec/tb-hash-xx.h               | 7 ++++---
 include/exec/tb-hash.h                  | 4 ++--
 include/hw/arm/exynos4210.h             | 7 +++----
 include/hw/gpio/imx_gpio.h              | 6 +++---
 include/hw/i2c/i2c-ddc.h                | 6 +++---
 include/hw/i2c/imx_i2c.h                | 6 +++---
 include/hw/input/adb.h                  | 6 +++---
 include/hw/intc/mips_gic.h              | 6 +++---
 include/hw/ppc/openpic.h                | 6 +++---
 include/hw/ppc/spapr.h                  | 6 +++---
 include/hw/ppc/spapr_drc.h              | 7 ++++---
 include/hw/ppc/spapr_vio.h              | 7 ++++---
 include/hw/ppc/xics.h                   | 7 ++++---
 include/hw/s390x/ebcdic.h               | 6 +++---
 include/hw/s390x/s390_flic.h            | 6 +++---
 include/hw/s390x/storage-keys.h         | 6 +++---
 include/hw/sd/sd.h                      | 7 ++++---
 include/hw/sh4/sh_intc.h                | 6 +++---
 include/hw/sparc/grlib.h                | 6 +++---
 include/hw/timer/mips_gictimer.h        | 6 +++---
 include/hw/virtio/vhost-backend.h       | 7 +++----
 include/hw/virtio/virtio-access.h       | 8 +++++---
 include/hw/virtio/virtio-balloon.h      | 4 ++--
 include/hw/virtio/virtio-blk.h          | 4 ++--
 include/hw/virtio/virtio-input.h        | 6 +++---
 include/hw/virtio/virtio-net.h          | 4 ++--
 include/hw/virtio/virtio-rng.h          | 4 ++--
 include/hw/virtio/virtio-scsi.h         | 6 +++---
 include/hw/virtio/virtio-serial.h       | 5 +++--
 include/hw/virtio/virtio.h              | 4 ++--
 include/io/channel-buffer.h             | 6 +++---
 include/io/channel-command.h            | 6 +++---
 include/io/channel-file.h               | 6 +++---
 include/io/channel-socket.h             | 6 +++---
 include/io/channel-tls.h                | 6 +++---
 include/io/channel-util.h               | 6 +++---
 include/io/channel-watch.h              | 6 +++---
 include/io/channel-websock.h            | 6 +++---
 include/io/channel.h                    | 6 +++---
 include/io/task.h                       | 6 +++---
 include/libdecnumber/decContext.h       | 5 +++--
 include/libdecnumber/decNumber.h        | 5 +++--
 include/libdecnumber/dpd/decimal128.h   | 5 +++--
 include/libdecnumber/dpd/decimal32.h    | 5 +++--
 include/libdecnumber/dpd/decimal64.h    | 5 +++--
 include/net/vhost-user.h                | 6 +++---
 include/qemu/acl.h                      | 6 +++---
 include/qemu/atomic.h                   | 8 +++-----
 include/qemu/base64.h                   | 6 +++---
 include/qemu/buffer.h                   | 6 +++---
 include/qemu/mmap-alloc.h               | 4 ++--
 include/qemu/queue.h                    | 6 +++---
 include/qemu/thread-posix.h             | 4 ++--
 include/qemu/thread-win32.h             | 4 ++--
 include/qemu/thread.h                   | 4 ++--
 include/sysemu/balloon.h                | 4 ++--
 include/sysemu/device_tree.h            | 6 +++---
 linux-user/arm/nwfpe/fpa11.h            | 4 ++--
 linux-user/arm/nwfpe/fpopcode.h         | 4 ++--
 linux-user/arm/nwfpe/fpsr.h             | 4 ++--
 linux-user/linux_loop.h                 | 5 +++--
 linux-user/tilegx/syscall_nr.h          | 4 ++--
 qemu-options.h                          | 4 ++--
 slirp/if.h                              | 4 ++--
 slirp/ip.h                              | 4 ++--
 slirp/ip6.h                             | 4 ++--
 slirp/ip_icmp.h                         | 4 ++--
 slirp/libslirp.h                        | 4 ++--
 slirp/mbuf.h                            | 4 ++--
 slirp/misc.h                            | 4 ++--
 slirp/sbuf.h                            | 4 ++--
 slirp/socket.h                          | 6 +++---
 slirp/tcp.h                             | 4 ++--
 slirp/tcp_timer.h                       | 4 ++--
 slirp/tcp_var.h                         | 4 ++--
 slirp/tcpip.h                           | 4 ++--
 slirp/udp.h                             | 4 ++--
 target-i386/svm.h                       | 4 ++--
 target-mips/kvm_mips.h                  | 6 +++---
 target-mips/mips-defs.h                 | 6 +++---
 target-ppc/helper_regs.h                | 6 +++---
 target-ppc/kvm_ppc.h                    | 6 +++---
 target-ppc/mmu-hash32.h                 | 6 +++---
 target-ppc/mmu-hash64.h                 | 6 +++---
 target-tricore/tricore-defs.h           | 6 +++---
 tests/boot-sector.h                     | 6 +++---
 tests/libqos/ahci.h                     | 4 ++--
 tests/libqos/libqos-pc.h                | 4 ++--
 tests/libqos/libqos.h                   | 4 ++--
 ui/keymaps.h                            | 6 +++---
 ui/sdl_zoom.h                           | 6 +++---
 ui/vnc-auth-sasl.h                      | 9 +++------
 ui/vnc-auth-vencrypt.h                  | 7 +++----
 ui/vnc-ws.h                             | 6 +++---
 ui/vnc.h                                | 6 +++---
 141 files changed, 385 insertions(+), 378 deletions(-)

diff --git a/contrib/ivshmem-client/ivshmem-client.h b/contrib/ivshmem-client/ivshmem-client.h
index 54cde17..5ee9422 100644
--- a/contrib/ivshmem-client/ivshmem-client.h
+++ b/contrib/ivshmem-client/ivshmem-client.h
@@ -6,8 +6,8 @@
  * top-level directory.
  */
 
-#ifndef _IVSHMEM_CLIENT_H_
-#define _IVSHMEM_CLIENT_H_
+#ifndef IVSHMEM_CLIENT_H
+#define IVSHMEM_CLIENT_H
 
 /**
  * This file provides helper to implement an ivshmem client. It is used
@@ -209,4 +209,4 @@ ivshmem_client_search_peer(IvshmemClient *client, int64_t peer_id);
  */
 void ivshmem_client_dump(const IvshmemClient *client);
 
-#endif /* _IVSHMEM_CLIENT_H_ */
+#endif /* IVSHMEM_CLIENT_H */
diff --git a/contrib/ivshmem-server/ivshmem-server.h b/contrib/ivshmem-server/ivshmem-server.h
index d37ca85..4af08e1 100644
--- a/contrib/ivshmem-server/ivshmem-server.h
+++ b/contrib/ivshmem-server/ivshmem-server.h
@@ -6,8 +6,8 @@
  * top-level directory.
  */
 
-#ifndef _IVSHMEM_SERVER_H_
-#define _IVSHMEM_SERVER_H_
+#ifndef IVSHMEM_SERVER_H
+#define IVSHMEM_SERVER_H
 
 /**
  * The ivshmem server is a daemon that creates a unix socket in listen
@@ -163,4 +163,4 @@ ivshmem_server_search_peer(IvshmemServer *server, int64_t peer_id);
  */
 void ivshmem_server_dump(const IvshmemServer *server);
 
-#endif /* _IVSHMEM_SERVER_H_ */
+#endif /* IVSHMEM_SERVER_H */
diff --git a/crypto/block-luks.h b/crypto/block-luks.h
index 0934138..b2d8a35 100644
--- a/crypto/block-luks.h
+++ b/crypto/block-luks.h
@@ -18,11 +18,11 @@
  *
  */
 
-#ifndef QCRYPTO_BLOCK_LUKS_H__
-#define QCRYPTO_BLOCK_LUKS_H__
+#ifndef QCRYPTO_BLOCK_LUKS_H
+#define QCRYPTO_BLOCK_LUKS_H
 
 #include "crypto/blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_luks;
 
-#endif /* QCRYPTO_BLOCK_LUKS_H__ */
+#endif /* QCRYPTO_BLOCK_LUKS_H */
diff --git a/crypto/block-qcow.h b/crypto/block-qcow.h
index 569f836..3e2c0a8 100644
--- a/crypto/block-qcow.h
+++ b/crypto/block-qcow.h
@@ -18,11 +18,11 @@
  *
  */
 
-#ifndef QCRYPTO_BLOCK_QCOW_H__
-#define QCRYPTO_BLOCK_QCOW_H__
+#ifndef QCRYPTO_BLOCK_QCOW_H
+#define QCRYPTO_BLOCK_QCOW_H
 
 #include "crypto/blockpriv.h"
 
 extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
 
-#endif /* QCRYPTO_BLOCK_QCOW_H__ */
+#endif /* QCRYPTO_BLOCK_QCOW_H */
diff --git a/fsdev/9p-iov-marshal.h b/fsdev/9p-iov-marshal.h
index 6bccbfb..1fb5016 100644
--- a/fsdev/9p-iov-marshal.h
+++ b/fsdev/9p-iov-marshal.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_9P_IOV_MARSHAL_H
-#define _QEMU_9P_IOV_MARSHAL_H
+#ifndef QEMU_9P_IOV_MARSHAL_H
+#define QEMU_9P_IOV_MARSHAL_H
 
 #include "9p-marshal.h"
 
diff --git a/fsdev/9p-marshal.h b/fsdev/9p-marshal.h
index e91b24e..140db6d 100644
--- a/fsdev/9p-marshal.h
+++ b/fsdev/9p-marshal.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_9P_MARSHAL_H
-#define _QEMU_9P_MARSHAL_H
+#ifndef QEMU_9P_MARSHAL_H
+#define QEMU_9P_MARSHAL_H
 
 typedef struct V9fsString
 {
diff --git a/hw/9pfs/9p-proxy.h b/hw/9pfs/9p-proxy.h
index ba9ca20..b84301d 100644
--- a/hw/9pfs/9p-proxy.h
+++ b/hw/9pfs/9p-proxy.h
@@ -9,8 +9,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
  */
-#ifndef _QEMU_9P_PROXY_H
-#define _QEMU_9P_PROXY_H
+
+#ifndef QEMU_9P_PROXY_H
+#define QEMU_9P_PROXY_H
 
 #define PROXY_MAX_IO_SZ (64 * 1024)
 #define V9FS_FD_VALID INT_MAX
diff --git a/hw/9pfs/9p-xattr.h b/hw/9pfs/9p-xattr.h
index 4d39a20..a853ea6 100644
--- a/hw/9pfs/9p-xattr.h
+++ b/hw/9pfs/9p-xattr.h
@@ -10,8 +10,9 @@
  * the COPYING file in the top-level directory.
  *
  */
-#ifndef _QEMU_9P_XATTR_H
-#define _QEMU_9P_XATTR_H
+
+#ifndef QEMU_9P_XATTR_H
+#define QEMU_9P_XATTR_H
 
 #include "qemu/xattr.h"
 
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index d2030fd..b4f757a 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_9P_H
-#define _QEMU_9P_H
+#ifndef QEMU_9P_H
+#define QEMU_9P_H
 
 #include <dirent.h>
 #include <utime.h>
diff --git a/hw/9pfs/coth.h b/hw/9pfs/coth.h
index 5b02a63..3c7424e 100644
--- a/hw/9pfs/coth.h
+++ b/hw/9pfs/coth.h
@@ -12,8 +12,8 @@
  *
  */
 
-#ifndef _QEMU_9P_COTH_H
-#define _QEMU_9P_COTH_H
+#ifndef QEMU_9P_COTH_H
+#define QEMU_9P_COTH_H
 
 #include "qemu/thread.h"
 #include "qemu/coroutine.h"
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h
index 7f6d885..7586b79 100644
--- a/hw/9pfs/virtio-9p.h
+++ b/hw/9pfs/virtio-9p.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_VIRTIO_9P_H
-#define _QEMU_VIRTIO_9P_H
+#ifndef QEMU_VIRTIO_9P_H
+#define QEMU_VIRTIO_9P_H
 
 #include "standard-headers/linux/virtio_9p.h"
 #include "hw/virtio/virtio.h"
diff --git a/hw/arm/strongarm.h b/hw/arm/strongarm.h
index cd32bbd..1470eac 100644
--- a/hw/arm/strongarm.h
+++ b/hw/arm/strongarm.h
@@ -1,5 +1,5 @@
-#ifndef _STRONGARM_H
-#define _STRONGARM_H
+#ifndef STRONGARM_H
+#define STRONGARM_H
 
 #include "exec/memory.h"
 #include "target-arm/cpu-qom.h"
diff --git a/hw/audio/fmopl.h b/hw/audio/fmopl.h
index 24ba5f4..fdda7f9 100644
--- a/hw/audio/fmopl.h
+++ b/hw/audio/fmopl.h
@@ -1,5 +1,5 @@
-#ifndef __FMOPL_H_
-#define __FMOPL_H_
+#ifndef FMOPL_H
+#define FMOPL_H
 
 /* --- select emulation chips --- */
 #define BUILD_YM3812 (HAS_YM3812)
diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 0738684..3300b6f 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -1,5 +1,5 @@
-#ifndef __XEN_BLKIF_H__
-#define __XEN_BLKIF_H__
+#ifndef XEN_BLKIF_H
+#define XEN_BLKIF_H
 
 #include <xen/io/ring.h>
 #include <xen/io/blkif.h>
@@ -143,4 +143,4 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst,
     }
 }
 
-#endif /* __XEN_BLKIF_H__ */
+#endif /* XEN_BLKIF_H */
diff --git a/hw/core/uboot_image.h b/hw/core/uboot_image.h
index 9fc2760..34c11a7 100644
--- a/hw/core/uboot_image.h
+++ b/hw/core/uboot_image.h
@@ -26,8 +26,8 @@
  ********************************************************************
  */
 
-#ifndef __UBOOT_IMAGE_H__
-#define __UBOOT_IMAGE_H__
+#ifndef UBOOT_IMAGE_H
+#define UBOOT_IMAGE_H
 
 /*
  * Operating System Codes
@@ -155,4 +155,4 @@ typedef struct uboot_image_header {
 } uboot_image_header_t;
 
 
-#endif	/* __IMAGE_H__ */
+#endif /* UBOOT_IMAGE_H */
diff --git a/hw/display/vga.h b/hw/display/vga.h
index d917046..16886f5 100644
--- a/hw/display/vga.h
+++ b/hw/display/vga.h
@@ -14,8 +14,8 @@
  *
  */
 
-#ifndef __linux_video_vga_h__
-#define __linux_video_vga_h__
+#ifndef LINUX_VIDEO_VGA_H
+#define LINUX_VIDEO_VGA_H
 
 /* Some of the code below is taken from SVGAlib.  The original,
    unmodified copyright notice for that code is below. */
@@ -156,4 +156,4 @@
 /* VGA graphics controller bit masks */
 #define VGA_GR06_GRAPHICS_MODE  0x01
 
-#endif /* __linux_video_vga_h__ */
+#endif /* LINUX_VIDEO_VGA_H */
diff --git a/hw/microblaze/boot.h b/hw/microblaze/boot.h
index 0eb7f8e..dd1090d 100644
--- a/hw/microblaze/boot.h
+++ b/hw/microblaze/boot.h
@@ -1,5 +1,5 @@
-#ifndef __MICROBLAZE_BOOT__
-#define __MICROBLAZE_BOOT__
+#ifndef MICROBLAZE_BOOT_H
+#define MICROBLAZE_BOOT_H
 
 #include "hw/hw.h"
 
@@ -9,4 +9,4 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                             const char *dtb_filename,
                             void (*machine_cpu_reset)(MicroBlazeCPU *));
 
-#endif /* __MICROBLAZE_BOOT __ */
+#endif /* MICROBLAZE_BOOT_H */
diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h
index e7dc0a4..30c828e 100644
--- a/hw/net/fsl_etsec/etsec.h
+++ b/hw/net/fsl_etsec/etsec.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef _ETSEC_H_
-#define _ETSEC_H_
+
+#ifndef ETSEC_H
+#define ETSEC_H
 
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
@@ -173,4 +174,4 @@ void etsec_write_miim(eTSEC          *etsec,
 
 void etsec_miim_link_status(eTSEC *etsec, NetClientState *nc);
 
-#endif /* ! _ETSEC_H_ */
+#endif /* ETSEC_H */
diff --git a/hw/net/fsl_etsec/registers.h b/hw/net/fsl_etsec/registers.h
index 6fb9684..c4ed2b9 100644
--- a/hw/net/fsl_etsec/registers.h
+++ b/hw/net/fsl_etsec/registers.h
@@ -21,9 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef _ETSEC_REGISTERS_H_
-#define _ETSEC_REGISTERS_H_
 
+#ifndef ETSEC_REGISTERS_H
+#define ETSEC_REGISTERS_H
 
 enum eTSEC_Register_Access_Type {
     ACC_RW      = 1,            /* Read/Write */
@@ -316,4 +316,4 @@ extern const eTSEC_Register_Definition eTSEC_registers_def[];
 #define TMR_ETTS2_H  (0xEA8 / 4)
 #define TMR_ETTS2_L  (0xEAC / 4)
 
-#endif /* ! _ETSEC_REGISTERS_H_ */
+#endif /* ETSEC_REGISTERS_H */
diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h
index f9c80f8..7ae0495 100644
--- a/hw/net/rocker/rocker.h
+++ b/hw/net/rocker/rocker.h
@@ -16,8 +16,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef _ROCKER_H_
-#define _ROCKER_H_
+#ifndef ROCKER_H
+#define ROCKER_H
 
 #include "qemu/sockets.h"
 
@@ -81,4 +81,4 @@ int rx_produce(World *world, uint32_t pport,
 int rocker_port_eg(Rocker *r, uint32_t pport,
                    const struct iovec *iov, int iovcnt);
 
-#endif /* _ROCKER_H_ */
+#endif /* ROCKER_H */
diff --git a/hw/net/rocker/rocker_desc.h b/hw/net/rocker/rocker_desc.h
index d4041f5..1dec335 100644
--- a/hw/net/rocker/rocker_desc.h
+++ b/hw/net/rocker/rocker_desc.h
@@ -14,9 +14,8 @@
  * GNU General Public License for more details.
  */
 
-
-#ifndef _ROCKER_DESC_H_
-#define _ROCKER_DESC_H_
+#ifndef ROCKER_DESC_H
+#define ROCKER_DESC_H
 
 #include "rocker_hw.h"
 
diff --git a/hw/net/rocker/rocker_fp.h b/hw/net/rocker/rocker_fp.h
index 04592bb..dbe1dd3 100644
--- a/hw/net/rocker/rocker_fp.h
+++ b/hw/net/rocker/rocker_fp.h
@@ -14,8 +14,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef _ROCKER_FP_H_
-#define _ROCKER_FP_H_
+#ifndef ROCKER_FP_H
+#define ROCKER_FP_H
 
 #include "net/net.h"
 #include "qemu/iov.h"
@@ -51,4 +51,4 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
 void fp_port_free(FpPort *port);
 void fp_port_reset(FpPort *port);
 
-#endif /* _ROCKER_FP_H_ */
+#endif /* ROCKER_FP_H */
diff --git a/hw/net/rocker/rocker_hw.h b/hw/net/rocker/rocker_hw.h
index 8c50830..1786323 100644
--- a/hw/net/rocker/rocker_hw.h
+++ b/hw/net/rocker/rocker_hw.h
@@ -6,8 +6,8 @@
  *
  */
 
-#ifndef _ROCKER_HW_
-#define _ROCKER_HW_
+#ifndef ROCKER_HW_H
+#define ROCKER_HW_H
 
 #define __le16 uint16_t
 #define __le32 uint32_t
@@ -490,4 +490,4 @@ enum rocker_of_dpa_overlay_type {
  */
 #define ROCKER_CONTROL_RESET            (1 << 0)
 
-#endif /* _ROCKER_HW_ */
+#endif /* ROCKER_HW_H */
diff --git a/hw/net/rocker/rocker_of_dpa.h b/hw/net/rocker/rocker_of_dpa.h
index f3f6d77..01c7a97 100644
--- a/hw/net/rocker/rocker_of_dpa.h
+++ b/hw/net/rocker/rocker_of_dpa.h
@@ -14,9 +14,9 @@
  * GNU General Public License for more details.
  */
 
-#ifndef _ROCKER_OF_DPA_H_
-#define _ROCKER_OF_DPA_H_
+#ifndef ROCKER_OF_DPA_H
+#define ROCKER_OF_DPA_H
 
 World *of_dpa_world_alloc(Rocker *r);
 
-#endif /* _ROCKER_OF_DPA_H_ */
+#endif /* ROCKER_OF_DPA_H */
diff --git a/hw/net/rocker/rocker_tlv.h b/hw/net/rocker/rocker_tlv.h
index 8856164..dd28d08 100644
--- a/hw/net/rocker/rocker_tlv.h
+++ b/hw/net/rocker/rocker_tlv.h
@@ -14,8 +14,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef _ROCKER_TLV_H_
-#define _ROCKER_TLV_H_
+#ifndef ROCKER_TLV_H
+#define ROCKER_TLV_H
 
 #define ROCKER_TLV_ALIGNTO 8U
 #define ROCKER_TLV_ALIGN(len) \
diff --git a/hw/net/rocker/rocker_world.h b/hw/net/rocker/rocker_world.h
index 58ade47..44f1fe3 100644
--- a/hw/net/rocker/rocker_world.h
+++ b/hw/net/rocker/rocker_world.h
@@ -14,8 +14,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef _ROCKER_WORLD_H_
-#define _ROCKER_WORLD_H_
+#ifndef ROCKER_WORLD_H
+#define ROCKER_WORLD_H
 
 #include "rocker_hw.h"
 
@@ -58,4 +58,4 @@ const char *world_name(World *world);
 
 World *rocker_get_world(Rocker *r, enum rocker_world_type type);
 
-#endif /* _ROCKER_WORLD_H_ */
+#endif /* ROCKER_WORLD_H */
diff --git a/hw/net/vmxnet3.h b/hw/net/vmxnet3.h
index f7006af..f9352c4 100644
--- a/hw/net/vmxnet3.h
+++ b/hw/net/vmxnet3.h
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef _QEMU_VMXNET3_H
-#define _QEMU_VMXNET3_H
+#ifndef QEMU_VMXNET3_H
+#define QEMU_VMXNET3_H
 
 #define VMXNET3_DEVICE_MAX_TX_QUEUES 8
 #define VMXNET3_DEVICE_MAX_RX_QUEUES 8   /* Keep this value as a power of 2 */
diff --git a/hw/net/vmxnet_debug.h b/hw/net/vmxnet_debug.h
index 5aab00b..cb50aa9 100644
--- a/hw/net/vmxnet_debug.h
+++ b/hw/net/vmxnet_debug.h
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef _QEMU_VMXNET_DEBUG_H
-#define _QEMU_VMXNET_DEBUG_H
+#ifndef QEMU_VMXNET_DEBUG_H
+#define QEMU_VMXNET_DEBUG_H
 
 #define VMXNET_DEVICE_NAME "vmxnet3"
 
@@ -142,4 +142,4 @@
         }                                                                     \
     } while (0)
 
-#endif /* _QEMU_VMXNET3_DEBUG_H  */
+#endif /* QEMU_VMXNET_DEBUG_H */
diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index 5764b86..20cbddb 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#if !defined(__PPC_MAC_H__)
-#define __PPC_MAC_H__
+
+#ifndef PPC_MAC_H
+#define PPC_MAC_H
 
 #include "exec/memory.h"
 #include "hw/sysbus.h"
@@ -184,4 +185,4 @@ typedef struct MacIONVRAMState {
 } MacIONVRAMState;
 
 void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len);
-#endif /* !defined(__PPC_MAC_H__) */
+#endif /* PPC_MAC_H */
diff --git a/hw/sh4/sh7750_regnames.h b/hw/sh4/sh7750_regnames.h
index 7463709..e3ba886 100644
--- a/hw/sh4/sh7750_regnames.h
+++ b/hw/sh4/sh7750_regnames.h
@@ -1,6 +1,6 @@
-#ifndef _SH7750_REGNAMES_H
-#define _SH7750_REGNAMES_H
+#ifndef SH7750_REGNAMES_H
+#define SH7750_REGNAMES_H
 
 const char *regname(uint32_t addr);
 
-#endif				/* _SH7750_REGNAMES_H */
+#endif /* SH7750_REGNAMES_H */
diff --git a/hw/sh4/sh7750_regs.h b/hw/sh4/sh7750_regs.h
index 534aa48..3e4554a 100644
--- a/hw/sh4/sh7750_regs.h
+++ b/hw/sh4/sh7750_regs.h
@@ -16,8 +16,8 @@
  * @(#) sh7750_regs.h,v 1.2.4.1 2003/09/04 18:46:00 joel Exp
  */
 
-#ifndef __SH7750_REGS_H__
-#define __SH7750_REGS_H__
+#ifndef SH7750_REGS_H
+#define SH7750_REGS_H
 
 /*
  * All register has 2 addresses: in 0xff000000 - 0xffffffff (P4 address)  and
diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h
index 955f4e8..ade7891 100644
--- a/hw/xtensa/bootparam.h
+++ b/hw/xtensa/bootparam.h
@@ -1,5 +1,5 @@
-#ifndef HW_XTENSA_BOOTPARAM
-#define HW_XTENSA_BOOTPARAM
+#ifndef HW_XTENSA_BOOTPARAM_H
+#define HW_XTENSA_BOOTPARAM_H
 
 #define BP_TAG_COMMAND_LINE     0x1001  /* command line (0-terminated string)*/
 #define BP_TAG_INITRD           0x1002  /* ramdisk addr and size (bp_meminfo) */
diff --git a/include/crypto/afsplit.h b/include/crypto/afsplit.h
index 4cc4ca4..7dd21f0 100644
--- a/include/crypto/afsplit.h
+++ b/include/crypto/afsplit.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_AFSPLIT_H__
-#define QCRYPTO_AFSPLIT_H__
+#ifndef QCRYPTO_AFSPLIT_H
+#define QCRYPTO_AFSPLIT_H
 
 #include "crypto/hash.h"
 
@@ -132,4 +132,4 @@ int qcrypto_afsplit_decode(QCryptoHashAlgorithm hash,
                            uint8_t *out,
                            Error **errp);
 
-#endif /* QCRYPTO_AFSPLIT_H__ */
+#endif /* QCRYPTO_AFSPLIT_H */
diff --git a/include/crypto/block.h b/include/crypto/block.h
index a21e11f..8955211 100644
--- a/include/crypto/block.h
+++ b/include/crypto/block.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_BLOCK_H__
-#define QCRYPTO_BLOCK_H__
+#ifndef QCRYPTO_BLOCK_H
+#define QCRYPTO_BLOCK_H
 
 #include "crypto/cipher.h"
 #include "crypto/ivgen.h"
@@ -229,4 +229,4 @@ uint64_t qcrypto_block_get_payload_offset(QCryptoBlock *block);
  */
 void qcrypto_block_free(QCryptoBlock *block);
 
-#endif /* QCRYPTO_BLOCK_H__ */
+#endif /* QCRYPTO_BLOCK_H */
diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
index d770c48..376654d 100644
--- a/include/crypto/cipher.h
+++ b/include/crypto/cipher.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_CIPHER_H__
-#define QCRYPTO_CIPHER_H__
+#ifndef QCRYPTO_CIPHER_H
+#define QCRYPTO_CIPHER_H
 
 #include "qapi-types.h"
 
@@ -230,4 +230,4 @@ int qcrypto_cipher_setiv(QCryptoCipher *cipher,
                          const uint8_t *iv, size_t niv,
                          Error **errp);
 
-#endif /* QCRYPTO_CIPHER_H__ */
+#endif /* QCRYPTO_CIPHER_H */
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index f38caed..ca3267f 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_HASH_H__
-#define QCRYPTO_HASH_H__
+#ifndef QCRYPTO_HASH_H
+#define QCRYPTO_HASH_H
 
 #include "qapi-types.h"
 
@@ -189,4 +189,4 @@ int qcrypto_hash_base64(QCryptoHashAlgorithm alg,
                         char **base64,
                         Error **errp);
 
-#endif /* QCRYPTO_HASH_H__ */
+#endif /* QCRYPTO_HASH_H */
diff --git a/include/crypto/init.h b/include/crypto/init.h
index 2513ed0..04c1edf 100644
--- a/include/crypto/init.h
+++ b/include/crypto/init.h
@@ -18,9 +18,9 @@
  *
  */
 
-#ifndef QCRYPTO_INIT_H__
-#define QCRYPTO_INIT_H__
+#ifndef QCRYPTO_INIT_H
+#define QCRYPTO_INIT_H
 
 int qcrypto_init(Error **errp);
 
-#endif /* QCRYPTO_INIT_H__ */
+#endif /* QCRYPTO_INIT_H */
diff --git a/include/crypto/ivgen.h b/include/crypto/ivgen.h
index 09cdb6f..0350cd2 100644
--- a/include/crypto/ivgen.h
+++ b/include/crypto/ivgen.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_IVGEN_H__
-#define QCRYPTO_IVGEN_H__
+#ifndef QCRYPTO_IVGEN_H
+#define QCRYPTO_IVGEN_H
 
 #include "crypto/cipher.h"
 #include "crypto/hash.h"
@@ -203,4 +203,4 @@ QCryptoHashAlgorithm qcrypto_ivgen_get_hash(QCryptoIVGen *ivgen);
  */
 void qcrypto_ivgen_free(QCryptoIVGen *ivgen);
 
-#endif /* QCRYPTO_IVGEN_H__ */
+#endif /* QCRYPTO_IVGEN_H */
diff --git a/include/crypto/pbkdf.h b/include/crypto/pbkdf.h
index 58a1fe6..e9e4cec 100644
--- a/include/crypto/pbkdf.h
+++ b/include/crypto/pbkdf.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_PBKDF_H__
-#define QCRYPTO_PBKDF_H__
+#ifndef QCRYPTO_PBKDF_H
+#define QCRYPTO_PBKDF_H
 
 #include "crypto/hash.h"
 
@@ -149,4 +149,4 @@ int qcrypto_pbkdf2_count_iters(QCryptoHashAlgorithm hash,
                                const uint8_t *salt, size_t nsalt,
                                Error **errp);
 
-#endif /* QCRYPTO_PBKDF_H__ */
+#endif /* QCRYPTO_PBKDF_H */
diff --git a/include/crypto/random.h b/include/crypto/random.h
index f9308f4..a101353 100644
--- a/include/crypto/random.h
+++ b/include/crypto/random.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_RANDOM_H__
-#define QCRYPTO_RANDOM_H__
+#ifndef QCRYPTO_RANDOM_H
+#define QCRYPTO_RANDOM_H
 
 #include "qemu-common.h"
 #include "qapi/error.h"
@@ -41,4 +41,4 @@ int qcrypto_random_bytes(uint8_t *buf,
                          Error **errp);
 
 
-#endif /* QCRYPTO_RANDOM_H__ */
+#endif /* QCRYPTO_RANDOM_H */
diff --git a/include/crypto/secret.h b/include/crypto/secret.h
index b7392c6..07a963e 100644
--- a/include/crypto/secret.h
+++ b/include/crypto/secret.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QCRYPTO_SECRET_H__
-#define QCRYPTO_SECRET_H__
+#ifndef QCRYPTO_SECRET_H
+#define QCRYPTO_SECRET_H
 
 #include "qom/object.h"
 
@@ -143,4 +143,4 @@ extern char *qcrypto_secret_lookup_as_utf8(const char *secretid,
 extern char *qcrypto_secret_lookup_as_base64(const char *secretid,
                                              Error **errp);
 
-#endif /* QCRYPTO_SECRET_H__ */
+#endif /* QCRYPTO_SECRET_H */
diff --git a/include/crypto/xts.h b/include/crypto/xts.h
index c2924d8..da32ab8 100644
--- a/include/crypto/xts.h
+++ b/include/crypto/xts.h
@@ -23,9 +23,8 @@
  *
  */
 
-
-#ifndef QCRYPTO_XTS_H_
-#define QCRYPTO_XTS_H_
+#ifndef QCRYPTO_XTS_H
+#define QCRYPTO_XTS_H
 
 #include "qemu-common.h"
 #include "qapi/error.h"
@@ -83,4 +82,4 @@ void xts_encrypt(const void *datactx,
                  const uint8_t *src);
 
 
-#endif /* QCRYPTO_XTS_H_ */
+#endif /* QCRYPTO_XTS_H */
diff --git a/include/disas/disas.h b/include/disas/disas.h
index 4930d78..e549ca2 100644
--- a/include/disas/disas.h
+++ b/include/disas/disas.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_DISAS_H
-#define _QEMU_DISAS_H
+#ifndef QEMU_DISAS_H
+#define QEMU_DISAS_H
 
 #include "qemu-common.h"
 
@@ -42,4 +42,4 @@ struct syminfo {
 /* Filled in by elfload.c.  Simplistic, but will do for now. */
 extern struct syminfo *syminfos;
 
-#endif /* _QEMU_DISAS_H */
+#endif /* QEMU_DISAS_H */
diff --git a/include/elf.h b/include/elf.h
index 745739a..1c2975d 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -1,6 +1,5 @@
-#ifndef _QEMU_ELF_H
-#define _QEMU_ELF_H
-
+#ifndef QEMU_ELF_H
+#define QEMU_ELF_H
 
 /* 32-bit ELF base types. */
 typedef uint32_t Elf32_Addr;
@@ -1573,4 +1572,4 @@ struct elf32_fdpic_loadmap {
 #endif /* ELF_CLASS */
 
 
-#endif /* _QEMU_ELF_H */
+#endif /* QEMU_ELF_H */
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index db79ab6..acda7b6 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _EXEC_ALL_H_
-#define _EXEC_ALL_H_
+#ifndef EXEC_ALL_H
+#define EXEC_ALL_H
 
 #include "qemu-common.h"
 #include "exec/tb-context.h"
diff --git a/include/exec/tb-context.h b/include/exec/tb-context.h
index e209c1c..dce95d9 100644
--- a/include/exec/tb-context.h
+++ b/include/exec/tb-context.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef QEMU_TB_CONTEXT_H_
-#define QEMU_TB_CONTEXT_H_
+#ifndef QEMU_TB_CONTEXT_H
+#define QEMU_TB_CONTEXT_H
 
 #include "qemu/thread.h"
 #include "qemu/qht.h"
diff --git a/include/exec/tb-hash-xx.h b/include/exec/tb-hash-xx.h
index 85b741d..2c40b5c 100644
--- a/include/exec/tb-hash-xx.h
+++ b/include/exec/tb-hash-xx.h
@@ -30,8 +30,9 @@
  * You can contact the author at :
  * - xxHash source repository : https://github.com/Cyan4973/xxHash
  */
-#ifndef EXEC_TB_HASH_XX
-#define EXEC_TB_HASH_XX
+
+#ifndef EXEC_TB_HASH_XX_H
+#define EXEC_TB_HASH_XX_H
 
 #include "qemu/bitops.h"
 
@@ -91,4 +92,4 @@ uint32_t tb_hash_func5(uint64_t a0, uint64_t b0, uint32_t e)
     return h32;
 }
 
-#endif /* EXEC_TB_HASH_XX */
+#endif /* EXEC_TB_HASH_XX_H */
diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h
index 1d0200b..2c27490 100644
--- a/include/exec/tb-hash.h
+++ b/include/exec/tb-hash.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef EXEC_TB_HASH
-#define EXEC_TB_HASH
+#ifndef EXEC_TB_HASH_H
+#define EXEC_TB_HASH_H
 
 #include "exec/tb-hash-xx.h"
 
diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h
index b6d929d..29fef8b 100644
--- a/include/hw/arm/exynos4210.h
+++ b/include/hw/arm/exynos4210.h
@@ -22,9 +22,8 @@
  *
  */
 
-
-#ifndef EXYNOS4210_H_
-#define EXYNOS4210_H_
+#ifndef EXYNOS4210_H
+#define EXYNOS4210_H
 
 #include "qemu-common.h"
 #include "exec/memory.h"
@@ -135,4 +134,4 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
                                     CharDriverState *chr,
                                     qemu_irq irq);
 
-#endif /* EXYNOS4210_H_ */
+#endif /* EXYNOS4210_H */
diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h
index 4573570..ffab437 100644
--- a/include/hw/gpio/imx_gpio.h
+++ b/include/hw/gpio/imx_gpio.h
@@ -17,8 +17,8 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __IMX_GPIO_H_
-#define __IMX_GPIO_H_
+#ifndef IMX_GPIO_H
+#define IMX_GPIO_H
 
 #include "hw/sysbus.h"
 
@@ -60,4 +60,4 @@ typedef struct IMXGPIOState {
     qemu_irq output[IMX_GPIO_PIN_COUNT];
 } IMXGPIOState;
 
-#endif /* __IMX_GPIO_H_ */
+#endif /* IMX_GPIO_H */
diff --git a/include/hw/i2c/i2c-ddc.h b/include/hw/i2c/i2c-ddc.h
index cb8e62d..d9b5f33 100644
--- a/include/hw/i2c/i2c-ddc.h
+++ b/include/hw/i2c/i2c-ddc.h
@@ -16,8 +16,8 @@
  *  with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef I2C_DDC
-#define I2C_DDC
+#ifndef I2C_DDC_H
+#define I2C_DDC_H
 
 /* A simple I2C slave which just returns the contents of its EDID blob. */
 
@@ -35,4 +35,4 @@ typedef struct I2CDDCState I2CDDCState;
 #define TYPE_I2CDDC "i2c-ddc"
 #define I2CDDC(obj) OBJECT_CHECK(I2CDDCState, (obj), TYPE_I2CDDC)
 
-#endif /* !I2C_DDC */
+#endif /* I2C_DDC_H */
diff --git a/include/hw/i2c/imx_i2c.h b/include/hw/i2c/imx_i2c.h
index fb95df5..7c73a1f 100644
--- a/include/hw/i2c/imx_i2c.h
+++ b/include/hw/i2c/imx_i2c.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef __IMX_I2C_H_
-#define __IMX_I2C_H_
+#ifndef IMX_I2C_H
+#define IMX_I2C_H
 
 #include "hw/sysbus.h"
 
@@ -84,4 +84,4 @@ typedef struct IMXI2CState {
     uint16_t i2dr_write;
 } IMXI2CState;
 
-#endif /* __IMX_I2C_H_ */
+#endif /* IMX_I2C_H */
diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h
index db51d03..3ae8445 100644
--- a/include/hw/input/adb.h
+++ b/include/hw/input/adb.h
@@ -23,8 +23,8 @@
  * THE SOFTWARE.
  */
 
-#if !defined(__ADB_H__)
-#define __ADB_H__
+#ifndef ADB_H
+#define ADB_H
 
 #include "hw/qdev.h"
 
@@ -84,4 +84,4 @@ int adb_poll(ADBBusState *s, uint8_t *buf_out, uint16_t poll_mask);
 #define TYPE_ADB_KEYBOARD "adb-keyboard"
 #define TYPE_ADB_MOUSE "adb-mouse"
 
-#endif /* !defined(__ADB_H__) */
+#endif /* ADB_H */
diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h
index dd6d44d..b98d500 100644
--- a/include/hw/intc/mips_gic.h
+++ b/include/hw/intc/mips_gic.h
@@ -8,8 +8,8 @@
  *
  */
 
-#ifndef _MIPS_GIC_H
-#define _MIPS_GIC_H
+#ifndef MIPS_GIC_H
+#define MIPS_GIC_H
 
 #include "hw/timer/mips_gictimer.h"
 #include "cpu.h"
@@ -213,4 +213,4 @@ struct MIPSGICState {
     int32_t num_irq;
 };
 
-#endif /* _MIPS_GIC_H */
+#endif /* MIPS_GIC_H */
diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
index afe950b..6137e2d 100644
--- a/include/hw/ppc/openpic.h
+++ b/include/hw/ppc/openpic.h
@@ -1,5 +1,5 @@
-#if !defined(__OPENPIC_H__)
-#define __OPENPIC_H__
+#ifndef OPENPIC_H
+#define OPENPIC_H
 
 #include "qemu-common.h"
 #include "hw/qdev-core.h"
@@ -30,4 +30,4 @@ enum {
 #define TYPE_KVM_OPENPIC "kvm-openpic"
 int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs);
 
-#endif /* __OPENPIC_H__ */
+#endif /* OPENPIC_H */
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 2e2dd14..bd8ac28 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -1,5 +1,5 @@
-#if !defined(__HW_SPAPR_H__)
-#define __HW_SPAPR_H__
+#ifndef HW_SPAPR_H
+#define HW_SPAPR_H
 
 #include "sysemu/dma.h"
 #include "hw/boards.h"
@@ -648,4 +648,4 @@ int spapr_rng_populate_dt(void *fdt);
 #define SPAPR_LMB_FLAGS_DRC_INVALID 0x00000020
 #define SPAPR_LMB_FLAGS_RESERVED 0x00000080
 
-#endif /* !defined (__HW_SPAPR_H__) */
+#endif /* HW_SPAPR_H */
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 6aa506f..fa531d5 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -9,8 +9,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#if !defined(__HW_SPAPR_DRC_H__)
-#define __HW_SPAPR_DRC_H__
+
+#ifndef HW_SPAPR_DRC_H
+#define HW_SPAPR_DRC_H
 
 #include <libfdt.h>
 #include "qom/object.h"
@@ -202,4 +203,4 @@ sPAPRDRConnector *spapr_dr_connector_by_id(sPAPRDRConnectorType type,
 int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
                           uint32_t drc_type_mask);
 
-#endif /* __HW_SPAPR_DRC_H__ */
+#endif /* HW_SPAPR_DRC_H */
diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h
index bdb5d2f..d4a1e2c 100644
--- a/include/hw/ppc/spapr_vio.h
+++ b/include/hw/ppc/spapr_vio.h
@@ -1,5 +1,6 @@
-#ifndef _HW_SPAPR_VIO_H
-#define _HW_SPAPR_VIO_H
+#ifndef HW_SPAPR_VIO_H
+#define HW_SPAPR_VIO_H
+
 /*
  * QEMU sPAPR VIO bus definitions
  *
@@ -145,4 +146,4 @@ extern const VMStateDescription vmstate_spapr_vio;
 
 void spapr_vio_set_bypass(VIOsPAPRDevice *dev, bool bypass);
 
-#endif /* _HW_SPAPR_VIO_H */
+#endif /* HW_SPAPR_VIO_H */
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 6189a3b..2db9f93 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -24,8 +24,9 @@
  * THE SOFTWARE.
  *
  */
-#if !defined(__XICS_H__)
-#define __XICS_H__
+
+#ifndef XICS_H
+#define XICS_H
 
 #include "hw/sysbus.h"
 
@@ -196,4 +197,4 @@ void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
 
 int xics_find_source(XICSState *icp, int irq);
 
-#endif /* __XICS_H__ */
+#endif /* XICS_H */
diff --git a/include/hw/s390x/ebcdic.h b/include/hw/s390x/ebcdic.h
index 1d6fde9..69a04ca 100644
--- a/include/hw/s390x/ebcdic.h
+++ b/include/hw/s390x/ebcdic.h
@@ -9,8 +9,8 @@
  *
  */
 
-#ifndef EBCDIC_H_
-#define EBCDIC_H_
+#ifndef EBCDIC_H
+#define EBCDIC_H
 
 /* EBCDIC handling */
 static const uint8_t ebcdic2ascii[] = {
@@ -101,4 +101,4 @@ static inline void ascii_put(uint8_t *p, const char *ebcdic, int len)
     }
 }
 
-#endif /* EBCDIC_H_ */
+#endif /* EBCDIC_H */
diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h
index 1dac2ee..9094eda 100644
--- a/include/hw/s390x/s390_flic.h
+++ b/include/hw/s390x/s390_flic.h
@@ -10,8 +10,8 @@
  * directory.
  */
 
-#ifndef __HW_S390_FLIC_H
-#define __HW_S390_FLIC_H
+#ifndef HW_S390_FLIC_H
+#define HW_S390_FLIC_H
 
 #include "hw/sysbus.h"
 #include "hw/s390x/adapter.h"
@@ -78,4 +78,4 @@ static inline DeviceState *s390_flic_kvm_create(void)
 }
 #endif
 
-#endif /* __HW_S390_FLIC_H */
+#endif /* HW_S390_FLIC_H */
diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-keys.h
index 5ed7a0e..62df48e 100644
--- a/include/hw/s390x/storage-keys.h
+++ b/include/hw/s390x/storage-keys.h
@@ -9,8 +9,8 @@
  * directory.
  */
 
-#ifndef __S390_STORAGE_KEYS_H
-#define __S390_STORAGE_KEYS_H
+#ifndef S390_STORAGE_KEYS_H
+#define S390_STORAGE_KEYS_H
 
 #include "hw/qdev.h"
 #include "monitor/monitor.h"
@@ -57,4 +57,4 @@ S390SKeysState *s390_get_skeys_device(void);
 void hmp_dump_skeys(Monitor *mon, const QDict *qdict);
 void hmp_info_skeys(Monitor *mon, const QDict *qdict);
 
-#endif /* __S390_STORAGE_KEYS_H */
+#endif /* S390_STORAGE_KEYS_H */
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index c8a4b98..79909b2 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -26,8 +26,9 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef __hw_sd_h
-#define __hw_sd_h		1
+
+#ifndef HW_SD_H
+#define HW_SD_H
 
 #include "hw/qdev.h"
 
@@ -144,4 +145,4 @@ bool sdbus_get_readonly(SDBus *sd);
 void sdbus_set_inserted(SDBus *sd, bool inserted);
 void sdbus_set_readonly(SDBus *sd, bool inserted);
 
-#endif	/* __hw_sd_h */
+#endif /* HW_SD_H */
diff --git a/include/hw/sh4/sh_intc.h b/include/hw/sh4/sh_intc.h
index b7ddcb0..7913bc4 100644
--- a/include/hw/sh4/sh_intc.h
+++ b/include/hw/sh4/sh_intc.h
@@ -1,5 +1,5 @@
-#ifndef __SH_INTC_H__
-#define __SH_INTC_H__
+#ifndef SH_INTC_H
+#define SH_INTC_H
 
 #include "qemu-common.h"
 #include "hw/irq.h"
@@ -80,4 +80,4 @@ int sh_intc_init(MemoryRegion *sysmem,
 
 void sh_intc_set_irl(void *opaque, int n, int level);
 
-#endif /* __SH_INTC_H__ */
+#endif /* SH_INTC_H */
diff --git a/include/hw/sparc/grlib.h b/include/hw/sparc/grlib.h
index 9a0db7b..afbb9bc 100644
--- a/include/hw/sparc/grlib.h
+++ b/include/hw/sparc/grlib.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef _GRLIB_H_
-#define _GRLIB_H_
+#ifndef GRLIB_H
+#define GRLIB_H
 
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
@@ -117,4 +117,4 @@ DeviceState *grlib_apbuart_create(hwaddr  base,
     return dev;
 }
 
-#endif /* ! _GRLIB_H_ */
+#endif /* GRLIB_H */
diff --git a/include/hw/timer/mips_gictimer.h b/include/hw/timer/mips_gictimer.h
index e3ca45c..c8bc5d2 100644
--- a/include/hw/timer/mips_gictimer.h
+++ b/include/hw/timer/mips_gictimer.h
@@ -7,8 +7,8 @@
  *
  */
 
-#ifndef _MIPS_GICTIMER_H_
-#define _MIPS_GICTIMER_H_
+#ifndef MIPS_GICTIMER_H
+#define MIPS_GICTIMER_H
 
 typedef struct MIPSGICTimerVPState MIPSGICTimerVPState;
 typedef struct MIPSGICTimerState MIPSGICTimerState;
@@ -43,4 +43,4 @@ void mips_gictimer_stop_count(MIPSGICTimerState *gic);
 MIPSGICTimerState *mips_gictimer_init(void *opaque, uint32_t nvps,
                                       MIPSGICTimerCB *cb);
 
-#endif /* _MIPS_GICTIMER_H_ */
+#endif /* MIPS_GICTIMER_H */
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
index 84e1cb7..cf7f0b5 100644
--- a/include/hw/virtio/vhost-backend.h
+++ b/include/hw/virtio/vhost-backend.h
@@ -8,9 +8,8 @@
  *
  */
 
-#ifndef VHOST_BACKEND_H_
-#define VHOST_BACKEND_H_
-
+#ifndef VHOST_BACKEND_H
+#define VHOST_BACKEND_H
 
 typedef enum VhostBackendType {
     VHOST_BACKEND_TYPE_NONE = 0,
@@ -110,4 +109,4 @@ extern const VhostOps user_ops;
 int vhost_set_backend_type(struct vhost_dev *dev,
                            VhostBackendType backend_type);
 
-#endif /* VHOST_BACKEND_H_ */
+#endif /* VHOST_BACKEND_H */
diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-access.h
index 4b28038..440b455 100644
--- a/include/hw/virtio/virtio-access.h
+++ b/include/hw/virtio/virtio-access.h
@@ -12,8 +12,10 @@
  * (at your option) any later version.
  *
  */
-#ifndef _QEMU_VIRTIO_ACCESS_H
-#define _QEMU_VIRTIO_ACCESS_H
+
+#ifndef QEMU_VIRTIO_ACCESS_H
+#define QEMU_VIRTIO_ACCESS_H
+
 #include "hw/virtio/virtio.h"
 #include "exec/address-spaces.h"
 
@@ -175,4 +177,4 @@ static inline void virtio_tswap64s(VirtIODevice *vdev, uint64_t *s)
 {
     *s = virtio_tswap64(vdev, *s);
 }
-#endif /* _QEMU_VIRTIO_ACCESS_H */
+#endif /* QEMU_VIRTIO_ACCESS_H */
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index 35f62ac..1ea13bd 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -12,8 +12,8 @@
  *
  */
 
-#ifndef _QEMU_VIRTIO_BALLOON_H
-#define _QEMU_VIRTIO_BALLOON_H
+#ifndef QEMU_VIRTIO_BALLOON_H
+#define QEMU_VIRTIO_BALLOON_H
 
 #include "standard-headers/linux/virtio_balloon.h"
 #include "hw/virtio/virtio.h"
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index e9bf463..180bd8d 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef _QEMU_VIRTIO_BLK_H
-#define _QEMU_VIRTIO_BLK_H
+#ifndef QEMU_VIRTIO_BLK_H
+#define QEMU_VIRTIO_BLK_H
 
 #include "standard-headers/linux/virtio_blk.h"
 #include "hw/virtio/virtio.h"
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index bddbd4b..55db310 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_VIRTIO_INPUT_H
-#define _QEMU_VIRTIO_INPUT_H
+#ifndef QEMU_VIRTIO_INPUT_H
+#define QEMU_VIRTIO_INPUT_H
 
 #include "ui/input.h"
 
@@ -105,4 +105,4 @@ void virtio_input_add_config(VirtIOInput *vinput,
 void virtio_input_idstr_config(VirtIOInput *vinput,
                                uint8_t select, const char *string);
 
-#endif /* _QEMU_VIRTIO_INPUT_H */
+#endif /* QEMU_VIRTIO_INPUT_H */
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index 0cabdb6..91ed97c 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef _QEMU_VIRTIO_NET_H
-#define _QEMU_VIRTIO_NET_H
+#ifndef QEMU_VIRTIO_NET_H
+#define QEMU_VIRTIO_NET_H
 
 #include "standard-headers/linux/virtio_net.h"
 #include "hw/virtio/virtio.h"
diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h
index 2bc1ee5..2d40abd 100644
--- a/include/hw/virtio/virtio-rng.h
+++ b/include/hw/virtio/virtio-rng.h
@@ -9,8 +9,8 @@
  * top-level directory.
  */
 
-#ifndef _QEMU_VIRTIO_RNG_H
-#define _QEMU_VIRTIO_RNG_H
+#ifndef QEMU_VIRTIO_RNG_H
+#define QEMU_VIRTIO_RNG_H
 
 #include "sysemu/rng.h"
 #include "sysemu/rng-random.h"
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index b515669..5e3f088 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef _QEMU_VIRTIO_SCSI_H
-#define _QEMU_VIRTIO_SCSI_H
+#ifndef QEMU_VIRTIO_SCSI_H
+#define QEMU_VIRTIO_SCSI_H
 
 /* Override CDB/sense data size: they are dynamic (guest controlled) in QEMU */
 #define VIRTIO_SCSI_CDB_SIZE 0
@@ -141,4 +141,4 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s);
 void virtio_scsi_dataplane_stop(VirtIOSCSI *s);
 void virtio_scsi_dataplane_notify(VirtIODevice *vdev, VirtIOSCSIReq *req);
 
-#endif /* _QEMU_VIRTIO_SCSI_H */
+#endif /* QEMU_VIRTIO_SCSI_H */
diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h
index 12a55a1..730c88d 100644
--- a/include/hw/virtio/virtio-serial.h
+++ b/include/hw/virtio/virtio-serial.h
@@ -12,8 +12,9 @@
  * the COPYING file in the top-level directory.
  *
  */
-#ifndef _QEMU_VIRTIO_SERIAL_H
-#define _QEMU_VIRTIO_SERIAL_H
+
+#ifndef QEMU_VIRTIO_SERIAL_H
+#define QEMU_VIRTIO_SERIAL_H
 
 #include "standard-headers/linux/virtio_console.h"
 #include "hw/qdev.h"
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 96b581d..8a681f5 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef _QEMU_VIRTIO_H
-#define _QEMU_VIRTIO_H
+#ifndef QEMU_VIRTIO_H
+#define QEMU_VIRTIO_H
 
 #include "hw/hw.h"
 #include "net/net.h"
diff --git a/include/io/channel-buffer.h b/include/io/channel-buffer.h
index 65c498b..3f4b3f2 100644
--- a/include/io/channel-buffer.h
+++ b/include/io/channel-buffer.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_BUFFER_H__
-#define QIO_CHANNEL_BUFFER_H__
+#ifndef QIO_CHANNEL_BUFFER_H
+#define QIO_CHANNEL_BUFFER_H
 
 #include "io/channel.h"
 
@@ -57,4 +57,4 @@ struct QIOChannelBuffer {
 QIOChannelBuffer *
 qio_channel_buffer_new(size_t capacity);
 
-#endif /* QIO_CHANNEL_BUFFER_H__ */
+#endif /* QIO_CHANNEL_BUFFER_H */
diff --git a/include/io/channel-command.h b/include/io/channel-command.h
index cfc177e..336d47f 100644
--- a/include/io/channel-command.h
+++ b/include/io/channel-command.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_COMMAND_H__
-#define QIO_CHANNEL_COMMAND_H__
+#ifndef QIO_CHANNEL_COMMAND_H
+#define QIO_CHANNEL_COMMAND_H
 
 #include "io/channel.h"
 
@@ -88,4 +88,4 @@ qio_channel_command_new_spawn(const char *const argv[],
                               Error **errp);
 
 
-#endif /* QIO_CHANNEL_COMMAND_H__ */
+#endif /* QIO_CHANNEL_COMMAND_H */
diff --git a/include/io/channel-file.h b/include/io/channel-file.h
index 308e6d4..d2462c2 100644
--- a/include/io/channel-file.h
+++ b/include/io/channel-file.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_FILE_H__
-#define QIO_CHANNEL_FILE_H__
+#ifndef QIO_CHANNEL_FILE_H
+#define QIO_CHANNEL_FILE_H
 
 #include "io/channel.h"
 
@@ -90,4 +90,4 @@ qio_channel_file_new_path(const char *path,
                           mode_t mode,
                           Error **errp);
 
-#endif /* QIO_CHANNEL_FILE_H__ */
+#endif /* QIO_CHANNEL_FILE_H */
diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h
index 70d06b4..711f8bf 100644
--- a/include/io/channel-socket.h
+++ b/include/io/channel-socket.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_SOCKET_H__
-#define QIO_CHANNEL_SOCKET_H__
+#ifndef QIO_CHANNEL_SOCKET_H
+#define QIO_CHANNEL_SOCKET_H
 
 #include "io/channel.h"
 #include "io/task.h"
@@ -248,4 +248,4 @@ qio_channel_socket_accept(QIOChannelSocket *ioc,
                           Error **errp);
 
 
-#endif /* QIO_CHANNEL_SOCKET_H__ */
+#endif /* QIO_CHANNEL_SOCKET_H */
diff --git a/include/io/channel-tls.h b/include/io/channel-tls.h
index 322eccb..d157eb1 100644
--- a/include/io/channel-tls.h
+++ b/include/io/channel-tls.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_TLS_H__
-#define QIO_CHANNEL_TLS_H__
+#ifndef QIO_CHANNEL_TLS_H
+#define QIO_CHANNEL_TLS_H
 
 #include "io/channel.h"
 #include "io/task.h"
@@ -139,4 +139,4 @@ void qio_channel_tls_handshake(QIOChannelTLS *ioc,
 QCryptoTLSSession *
 qio_channel_tls_get_session(QIOChannelTLS *ioc);
 
-#endif /* QIO_CHANNEL_TLS_H__ */
+#endif /* QIO_CHANNEL_TLS_H */
diff --git a/include/io/channel-util.h b/include/io/channel-util.h
index c93af82..c0b79cf 100644
--- a/include/io/channel-util.h
+++ b/include/io/channel-util.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_UTIL_H__
-#define QIO_CHANNEL_UTIL_H__
+#ifndef QIO_CHANNEL_UTIL_H
+#define QIO_CHANNEL_UTIL_H
 
 #include "io/channel.h"
 
@@ -49,4 +49,4 @@
 QIOChannel *qio_channel_new_fd(int fd,
                                Error **errp);
 
-#endif /* QIO_CHANNEL_UTIL_H__ */
+#endif /* QIO_CHANNEL_UTIL_H */
diff --git a/include/io/channel-watch.h b/include/io/channel-watch.h
index 76d7642..63bc4ae 100644
--- a/include/io/channel-watch.h
+++ b/include/io/channel-watch.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_WATCH_H__
-#define QIO_CHANNEL_WATCH_H__
+#ifndef QIO_CHANNEL_WATCH_H
+#define QIO_CHANNEL_WATCH_H
 
 #include "io/channel.h"
 
@@ -87,4 +87,4 @@ GSource *qio_channel_create_fd_pair_watch(QIOChannel *ioc,
                                           int fdwrite,
                                           GIOCondition condition);
 
-#endif /* QIO_CHANNEL_WATCH_H__ */
+#endif /* QIO_CHANNEL_WATCH_H */
diff --git a/include/io/channel-websock.h b/include/io/channel-websock.h
index 0dc21cc..3c9ff84 100644
--- a/include/io/channel-websock.h
+++ b/include/io/channel-websock.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_WEBSOCK_H__
-#define QIO_CHANNEL_WEBSOCK_H__
+#ifndef QIO_CHANNEL_WEBSOCK_H
+#define QIO_CHANNEL_WEBSOCK_H
 
 #include "io/channel.h"
 #include "qemu/buffer.h"
@@ -105,4 +105,4 @@ void qio_channel_websock_handshake(QIOChannelWebsock *ioc,
                                    gpointer opaque,
                                    GDestroyNotify destroy);
 
-#endif /* QIO_CHANNEL_WEBSOCK_H__ */
+#endif /* QIO_CHANNEL_WEBSOCK_H */
diff --git a/include/io/channel.h b/include/io/channel.h
index e52f059..752e89f 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_CHANNEL_H__
-#define QIO_CHANNEL_H__
+#ifndef QIO_CHANNEL_H
+#define QIO_CHANNEL_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
@@ -502,4 +502,4 @@ void qio_channel_yield(QIOChannel *ioc,
 void qio_channel_wait(QIOChannel *ioc,
                       GIOCondition condition);
 
-#endif /* QIO_CHANNEL_H__ */
+#endif /* QIO_CHANNEL_H */
diff --git a/include/io/task.h b/include/io/task.h
index df9499a..42028cb 100644
--- a/include/io/task.h
+++ b/include/io/task.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QIO_TASK_H__
-#define QIO_TASK_H__
+#ifndef QIO_TASK_H
+#define QIO_TASK_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
@@ -252,4 +252,4 @@ void qio_task_abort(QIOTask *task,
  */
 Object *qio_task_get_source(QIOTask *task);
 
-#endif /* QIO_TASK_H__ */
+#endif /* QIO_TASK_H */
diff --git a/include/libdecnumber/decContext.h b/include/libdecnumber/decContext.h
index 01365e2..cea6e42 100644
--- a/include/libdecnumber/decContext.h
+++ b/include/libdecnumber/decContext.h
@@ -50,8 +50,9 @@
 /*								      */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECCONTEXT)
-  #define DECCONTEXT
+#ifndef DECCONTEXT_H
+#define DECCONTEXT_H
+
   #define DECCNAME     "decContext"			/* Short name */
   #define DECCFULLNAME "Decimal Context Descriptor"   /* Verbose name */
   #define DECCAUTHOR   "Mike Cowlishaw"		      /* Who to blame */
diff --git a/include/libdecnumber/decNumber.h b/include/libdecnumber/decNumber.h
index 3f3a74a..aa115fe 100644
--- a/include/libdecnumber/decNumber.h
+++ b/include/libdecnumber/decNumber.h
@@ -32,8 +32,9 @@
 /* Decimal Number arithmetic module header			      */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECNUMBER)
-  #define DECNUMBER
+#ifndef DECNUMBER_H
+#define DECNUMBER_H
+
   #define DECNAME     "decNumber"			/* Short name */
   #define DECFULLNAME "Decimal Number Module"	      /* Verbose name */
   #define DECAUTHOR   "Mike Cowlishaw"		      /* Who to blame */
diff --git a/include/libdecnumber/dpd/decimal128.h b/include/libdecnumber/dpd/decimal128.h
index 13d1ae8..aff261e 100644
--- a/include/libdecnumber/dpd/decimal128.h
+++ b/include/libdecnumber/dpd/decimal128.h
@@ -32,8 +32,9 @@
 /* Decimal 128-bit format module header				      */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECIMAL128)
-  #define DECIMAL128
+#ifndef DECIMAL128_H
+#define DECIMAL128_H
+
   #define DEC128NAME	 "decimal128"		      /* Short name   */
   #define DEC128FULLNAME "Decimal 128-bit Number"     /* Verbose name */
   #define DEC128AUTHOR	 "Mike Cowlishaw"	      /* Who to blame */
diff --git a/include/libdecnumber/dpd/decimal32.h b/include/libdecnumber/dpd/decimal32.h
index 03c80db..6cb9e43 100644
--- a/include/libdecnumber/dpd/decimal32.h
+++ b/include/libdecnumber/dpd/decimal32.h
@@ -32,8 +32,9 @@
 /* Decimal 32-bit format module header				      */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECIMAL32)
-  #define DECIMAL32
+#ifndef DECIMAL32_H
+#define DECIMAL32_H
+
   #define DEC32NAME	"decimal32"		      /* Short name   */
   #define DEC32FULLNAME "Decimal 32-bit Number"	      /* Verbose name */
   #define DEC32AUTHOR	"Mike Cowlishaw"	      /* Who to blame */
diff --git a/include/libdecnumber/dpd/decimal64.h b/include/libdecnumber/dpd/decimal64.h
index a375faf..f29e570 100644
--- a/include/libdecnumber/dpd/decimal64.h
+++ b/include/libdecnumber/dpd/decimal64.h
@@ -32,8 +32,9 @@
 /* Decimal 64-bit format module header				      */
 /* ------------------------------------------------------------------ */
 
-#if !defined(DECIMAL64)
-  #define DECIMAL64
+#ifndef DECIMAL64_H
+#define DECIMAL64_H
+
   #define DEC64NAME	"decimal64"		      /* Short name   */
   #define DEC64FULLNAME "Decimal 64-bit Number"	      /* Verbose name */
   #define DEC64AUTHOR	"Mike Cowlishaw"	      /* Who to blame */
diff --git a/include/net/vhost-user.h b/include/net/vhost-user.h
index efae35d..5bcd8a6 100644
--- a/include/net/vhost-user.h
+++ b/include/net/vhost-user.h
@@ -8,11 +8,11 @@
  *
  */
 
-#ifndef VHOST_USER_H_
-#define VHOST_USER_H_
+#ifndef VHOST_USER_H
+#define VHOST_USER_H
 
 struct vhost_net;
 struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc);
 uint64_t vhost_user_get_acked_features(NetClientState *nc);
 
-#endif /* VHOST_USER_H_ */
+#endif /* VHOST_USER_H */
diff --git a/include/qemu/acl.h b/include/qemu/acl.h
index 4a403b7..7c44119 100644
--- a/include/qemu/acl.h
+++ b/include/qemu/acl.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef __QEMU_ACL_H__
-#define __QEMU_ACL_H__
+#ifndef QEMU_ACL_H
+#define QEMU_ACL_H
 
 #include "qemu/queue.h"
 
@@ -63,4 +63,4 @@ int qemu_acl_insert(qemu_acl *acl,
 int qemu_acl_remove(qemu_acl *acl,
 		    const char *match);
 
-#endif /* __QEMU_ACL_H__ */
+#endif /* QEMU_ACL_H */
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index 7a59096..7e13fca 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -12,10 +12,8 @@
  * atomic primitive is meant to provide.
  */
 
-#ifndef __QEMU_ATOMIC_H
-#define __QEMU_ATOMIC_H 1
-
-
+#ifndef QEMU_ATOMIC_H
+#define QEMU_ATOMIC_H
 
 /* Compiler barrier */
 #define barrier()   ({ asm volatile("" ::: "memory"); (void)0; })
@@ -366,4 +364,4 @@
 #define atomic_or(ptr, n)      ((void) __sync_fetch_and_or(ptr, n))
 
 #endif /* __ATOMIC_RELAXED */
-#endif /* __QEMU_ATOMIC_H */
+#endif /* QEMU_ATOMIC_H */
diff --git a/include/qemu/base64.h b/include/qemu/base64.h
index 793708d..815d852 100644
--- a/include/qemu/base64.h
+++ b/include/qemu/base64.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QEMU_BASE64_H__
-#define QEMU_BASE64_H__
+#ifndef QEMU_BASE64_H
+#define QEMU_BASE64_H
 
 #include "qemu-common.h"
 
@@ -55,4 +55,4 @@ uint8_t *qbase64_decode(const char *input,
                         Error **errp);
 
 
-#endif /* QEMU_BUFFER_H__ */
+#endif /* QEMU_BASE64_H */
diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h
index dead9b7..b2ead1f 100644
--- a/include/qemu/buffer.h
+++ b/include/qemu/buffer.h
@@ -18,8 +18,8 @@
  *
  */
 
-#ifndef QEMU_BUFFER_H__
-#define QEMU_BUFFER_H__
+#ifndef QEMU_BUFFER_H
+#define QEMU_BUFFER_H
 
 #include "qemu-common.h"
 
@@ -158,4 +158,4 @@ void buffer_move_empty(Buffer *to, Buffer *from);
  */
 void buffer_move(Buffer *to, Buffer *from);
 
-#endif /* QEMU_BUFFER_H__ */
+#endif /* QEMU_BUFFER_H */
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
index 0899b2f..933c024 100644
--- a/include/qemu/mmap-alloc.h
+++ b/include/qemu/mmap-alloc.h
@@ -1,5 +1,5 @@
-#ifndef QEMU_MMAP_ALLOC
-#define QEMU_MMAP_ALLOC
+#ifndef QEMU_MMAP_ALLOC_H
+#define QEMU_MMAP_ALLOC_H
 
 #include "qemu-common.h"
 
diff --git a/include/qemu/queue.h b/include/qemu/queue.h
index f781aa2..c2b6c81 100644
--- a/include/qemu/queue.h
+++ b/include/qemu/queue.h
@@ -37,8 +37,8 @@
  *      @(#)queue.h     8.5 (Berkeley) 8/20/94
  */
 
-#ifndef QEMU_SYS_QUEUE_H_
-#define QEMU_SYS_QUEUE_H_
+#ifndef QEMU_SYS_QUEUE_H
+#define QEMU_SYS_QUEUE_H
 
 /*
  * This file defines four types of data structures: singly-linked lists,
@@ -436,4 +436,4 @@ struct {                                                                \
 #define QTAILQ_PREV(elm, headname, field) \
         (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
 
-#endif  /* !QEMU_SYS_QUEUE_H_ */
+#endif /* QEMU_SYS_QUEUE_H */
diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h
index 24f8490..aa03567 100644
--- a/include/qemu/thread-posix.h
+++ b/include/qemu/thread-posix.h
@@ -1,5 +1,5 @@
-#ifndef __QEMU_THREAD_POSIX_H
-#define __QEMU_THREAD_POSIX_H 1
+#ifndef QEMU_THREAD_POSIX_H
+#define QEMU_THREAD_POSIX_H
 
 #include <pthread.h>
 #include <semaphore.h>
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h
index 1417d38..c7ce8dc 100644
--- a/include/qemu/thread-win32.h
+++ b/include/qemu/thread-win32.h
@@ -1,5 +1,5 @@
-#ifndef __QEMU_THREAD_WIN32_H
-#define __QEMU_THREAD_WIN32_H 1
+#ifndef QEMU_THREAD_WIN32_H
+#define QEMU_THREAD_WIN32_H
 
 #include <windows.h>
 
diff --git a/include/qemu/thread.h b/include/qemu/thread.h
index c5d71cf..31237e9 100644
--- a/include/qemu/thread.h
+++ b/include/qemu/thread.h
@@ -1,5 +1,5 @@
-#ifndef __QEMU_THREAD_H
-#define __QEMU_THREAD_H 1
+#ifndef QEMU_THREAD_H
+#define QEMU_THREAD_H
 
 #include "qemu/processor.h"
 #include "qemu/atomic.h"
diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h
index 3f976b4..af49e19 100644
--- a/include/sysemu/balloon.h
+++ b/include/sysemu/balloon.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef _QEMU_BALLOON_H
-#define _QEMU_BALLOON_H
+#ifndef QEMU_BALLOON_H
+#define QEMU_BALLOON_H
 
 #include "qapi-types.h"
 
diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h
index 705650a..e22e5be 100644
--- a/include/sysemu/device_tree.h
+++ b/include/sysemu/device_tree.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef __DEVICE_TREE_H__
-#define __DEVICE_TREE_H__
+#ifndef DEVICE_TREE_H
+#define DEVICE_TREE_H
 
 void *create_device_tree(int *sizep);
 void *load_device_tree(const char *filename_path, int *sizep);
@@ -168,4 +168,4 @@ int qemu_fdt_setprop_sized_cells_from_array(void *fdt,
 #define FDT_PCI_RANGE_IOPORT               0x01000000
 #define FDT_PCI_RANGE_CONFIG               0x00000000
 
-#endif /* __DEVICE_TREE_H__ */
+#endif /* DEVICE_TREE_H */
diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h
index 7f6f654..d459c5d 100644
--- a/linux-user/arm/nwfpe/fpa11.h
+++ b/linux-user/arm/nwfpe/fpa11.h
@@ -18,8 +18,8 @@
     along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __FPA11_H__
-#define __FPA11_H__
+#ifndef FPA11_H
+#define FPA11_H
 
 #include "cpu.h"
 
diff --git a/linux-user/arm/nwfpe/fpopcode.h b/linux-user/arm/nwfpe/fpopcode.h
index 1b1137f..06cd909 100644
--- a/linux-user/arm/nwfpe/fpopcode.h
+++ b/linux-user/arm/nwfpe/fpopcode.h
@@ -18,8 +18,8 @@
     along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __FPOPCODE_H__
-#define __FPOPCODE_H__
+#ifndef FPOPCODE_H
+#define FPOPCODE_H
 
 /*
 ARM Floating Point Instruction Classes
diff --git a/linux-user/arm/nwfpe/fpsr.h b/linux-user/arm/nwfpe/fpsr.h
index 859dcd5..8c978f0 100644
--- a/linux-user/arm/nwfpe/fpsr.h
+++ b/linux-user/arm/nwfpe/fpsr.h
@@ -18,8 +18,8 @@
     along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __FPSR_H__
-#define __FPSR_H__
+#ifndef FPSR_H
+#define FPSR_H
 
 /*
 The FPSR is a 32 bit register consisting of 4 parts, each exactly
diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
index 8974caa..1f52403 100644
--- a/linux-user/linux_loop.h
+++ b/linux-user/linux_loop.h
@@ -1,6 +1,7 @@
 /* Copied from 2.6.25 kernel headers to avoid problems on older hosts.  */
-#ifndef _LINUX_LOOP_H
-#define _LINUX_LOOP_H
+
+#ifndef LINUX_LOOP_H
+#define LINUX_LOOP_H
 
 /*
  * include/linux/loop.h
diff --git a/linux-user/tilegx/syscall_nr.h b/linux-user/tilegx/syscall_nr.h
index 87fb72c..8e30cd1 100644
--- a/linux-user/tilegx/syscall_nr.h
+++ b/linux-user/tilegx/syscall_nr.h
@@ -1,5 +1,5 @@
-#ifndef TILEGX_SYSCALL_NR
-#define TILEGX_SYSCALL_NR
+#ifndef TILEGX_SYSCALL_NR_H
+#define TILEGX_SYSCALL_NR_H
 
 /*
  * Copy from linux kernel asm-generic/unistd.h, which tilegx uses.
diff --git a/qemu-options.h b/qemu-options.h
index 89a009e..b4ee63c 100644
--- a/qemu-options.h
+++ b/qemu-options.h
@@ -25,8 +25,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef _QEMU_OPTIONS_H_
-#define _QEMU_OPTIONS_H_
+#ifndef QEMU_OPTIONS_H
+#define QEMU_OPTIONS_H
 
 enum {
 #define QEMU_OPTIONS_GENERATE_ENUM
diff --git a/slirp/if.h b/slirp/if.h
index c7a5c57..69569c1 100644
--- a/slirp/if.h
+++ b/slirp/if.h
@@ -5,8 +5,8 @@
  * terms and conditions of the copyright.
  */
 
-#ifndef _IF_H_
-#define _IF_H_
+#ifndef IF_H
+#define IF_H
 
 #define IF_COMPRESS	0x01	/* We want compression */
 #define IF_NOCOMPRESS	0x02	/* Do not do compression */
diff --git a/slirp/ip.h b/slirp/ip.h
index e2ee5e3..1df6723 100644
--- a/slirp/ip.h
+++ b/slirp/ip.h
@@ -30,8 +30,8 @@
  * ip.h,v 1.3 1994/08/21 05:27:30 paul Exp
  */
 
-#ifndef _IP_H_
-#define _IP_H_
+#ifndef IP_H
+#define IP_H
 
 #ifdef HOST_WORDS_BIGENDIAN
 # undef NTOHL
diff --git a/slirp/ip6.h b/slirp/ip6.h
index da23de6..0908855 100644
--- a/slirp/ip6.h
+++ b/slirp/ip6.h
@@ -3,8 +3,8 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#ifndef SLIRP_IP6_H_
-#define SLIRP_IP6_H_
+#ifndef SLIRP_IP6_H
+#define SLIRP_IP6_H
 
 #include "net/eth.h"
 
diff --git a/slirp/ip_icmp.h b/slirp/ip_icmp.h
index 846761d..d88ab34 100644
--- a/slirp/ip_icmp.h
+++ b/slirp/ip_icmp.h
@@ -30,8 +30,8 @@
  * ip_icmp.h,v 1.4 1995/05/30 08:09:43 rgrimes Exp
  */
 
-#ifndef _NETINET_IP_ICMP_H_
-#define _NETINET_IP_ICMP_H_
+#ifndef NETINET_IP_ICMP_H
+#define NETINET_IP_ICMP_H
 
 /*
  * Interface Control Message Protocol Definitions.
diff --git a/slirp/libslirp.h b/slirp/libslirp.h
index b6fc584..f90f0f5 100644
--- a/slirp/libslirp.h
+++ b/slirp/libslirp.h
@@ -1,5 +1,5 @@
-#ifndef _LIBSLIRP_H
-#define _LIBSLIRP_H
+#ifndef LIBSLIRP_H
+#define LIBSLIRP_H
 
 #include "qemu-common.h"
 
diff --git a/slirp/mbuf.h b/slirp/mbuf.h
index 36fb814..893601f 100644
--- a/slirp/mbuf.h
+++ b/slirp/mbuf.h
@@ -30,8 +30,8 @@
  * mbuf.h,v 1.9 1994/11/14 13:54:20 bde Exp
  */
 
-#ifndef _MBUF_H_
-#define _MBUF_H_
+#ifndef MBUF_H
+#define MBUF_H
 
 #define MINCSIZE 4096	/* Amount to increase mbuf if too small */
 
diff --git a/slirp/misc.h b/slirp/misc.h
index 0d0c059..5211bbd 100644
--- a/slirp/misc.h
+++ b/slirp/misc.h
@@ -5,8 +5,8 @@
  * terms and conditions of the copyright.
  */
 
-#ifndef _MISC_H_
-#define _MISC_H_
+#ifndef MISC_H
+#define MISC_H
 
 struct ex_list {
 	int ex_pty;			/* Do we want a pty? */
diff --git a/slirp/sbuf.h b/slirp/sbuf.h
index 4f22e7c..efcec39 100644
--- a/slirp/sbuf.h
+++ b/slirp/sbuf.h
@@ -5,8 +5,8 @@
  * terms and conditions of the copyright.
  */
 
-#ifndef _SBUF_H_
-#define _SBUF_H_
+#ifndef SBUF_H
+#define SBUF_H
 
 #define sbflush(sb) sbdrop((sb),(sb)->sb_cc)
 #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc)
diff --git a/slirp/socket.h b/slirp/socket.h
index b602e69..8feed2a 100644
--- a/slirp/socket.h
+++ b/slirp/socket.h
@@ -5,8 +5,8 @@
  * terms and conditions of the copyright.
  */
 
-#ifndef _SLIRP_SOCKET_H_
-#define _SLIRP_SOCKET_H_
+#ifndef SLIRP_SOCKET_H
+#define SLIRP_SOCKET_H
 
 #define SO_EXPIRE 240000
 #define SO_EXPIREFAST 10000
@@ -158,4 +158,4 @@ void sotranslate_in(struct socket *, struct sockaddr_storage *);
 void sotranslate_accept(struct socket *);
 
 
-#endif /* _SOCKET_H_ */
+#endif /* SLIRP_SOCKET_H */
diff --git a/slirp/tcp.h b/slirp/tcp.h
index 61befcd..174d3d9 100644
--- a/slirp/tcp.h
+++ b/slirp/tcp.h
@@ -30,8 +30,8 @@
  * tcp.h,v 1.3 1994/08/21 05:27:34 paul Exp
  */
 
-#ifndef _TCP_H_
-#define _TCP_H_
+#ifndef TCP_H
+#define TCP_H
 
 typedef	uint32_t tcp_seq;
 
diff --git a/slirp/tcp_timer.h b/slirp/tcp_timer.h
index ff17914..b25b391 100644
--- a/slirp/tcp_timer.h
+++ b/slirp/tcp_timer.h
@@ -30,8 +30,8 @@
  * tcp_timer.h,v 1.4 1994/08/21 05:27:38 paul Exp
  */
 
-#ifndef _TCP_TIMER_H_
-#define _TCP_TIMER_H_
+#ifndef TCP_TIMER_H
+#define TCP_TIMER_H
 
 /*
  * Definitions of the TCP timers.  These timers are counted
diff --git a/slirp/tcp_var.h b/slirp/tcp_var.h
index 004193f..0f8f187 100644
--- a/slirp/tcp_var.h
+++ b/slirp/tcp_var.h
@@ -30,8 +30,8 @@
  * tcp_var.h,v 1.3 1994/08/21 05:27:39 paul Exp
  */
 
-#ifndef _TCP_VAR_H_
-#define _TCP_VAR_H_
+#ifndef TCP_VAR_H
+#define TCP_VAR_H
 
 #include "tcpip.h"
 #include "tcp_timer.h"
diff --git a/slirp/tcpip.h b/slirp/tcpip.h
index 124b4a9..7bdb971 100644
--- a/slirp/tcpip.h
+++ b/slirp/tcpip.h
@@ -30,8 +30,8 @@
  * tcpip.h,v 1.3 1994/08/21 05:27:40 paul Exp
  */
 
-#ifndef _TCPIP_H_
-#define _TCPIP_H_
+#ifndef TCPIP_H
+#define TCPIP_H
 
 /*
  * Tcp+ip header, after ip options removed.
diff --git a/slirp/udp.h b/slirp/udp.h
index 10cc780..be657cf 100644
--- a/slirp/udp.h
+++ b/slirp/udp.h
@@ -30,8 +30,8 @@
  * udp.h,v 1.3 1994/08/21 05:27:41 paul Exp
  */
 
-#ifndef _UDP_H_
-#define _UDP_H_
+#ifndef UDP_H
+#define UDP_H
 
 #define UDP_TTL 0x60
 #define UDP_UDPDATALEN 16192
diff --git a/target-i386/svm.h b/target-i386/svm.h
index 04193ed..922c8fd 100644
--- a/target-i386/svm.h
+++ b/target-i386/svm.h
@@ -1,5 +1,5 @@
-#ifndef __SVM_H
-#define __SVM_H
+#ifndef SVM_H
+#define SVM_H
 
 #define TLB_CONTROL_DO_NOTHING 0
 #define TLB_CONTROL_FLUSH_ALL_ASID 1
diff --git a/target-mips/kvm_mips.h b/target-mips/kvm_mips.h
index 54f5965..ae957f3 100644
--- a/target-mips/kvm_mips.h
+++ b/target-mips/kvm_mips.h
@@ -9,8 +9,8 @@
  * Authors: Sanjay Lal <sanjayl@kymasys.com>
 */
 
-#ifndef __KVM_MIPS_H__
-#define __KVM_MIPS_H__
+#ifndef KVM_MIPS_H
+#define KVM_MIPS_H
 
 /**
  * kvm_mips_reset_vcpu:
@@ -23,4 +23,4 @@ void kvm_mips_reset_vcpu(MIPSCPU *cpu);
 int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq, int level);
 int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int irq, int level);
 
-#endif /* __KVM_MIPS_H__ */
+#endif /* KVM_MIPS_H */
diff --git a/target-mips/mips-defs.h b/target-mips/mips-defs.h
index 53b185e..047554e 100644
--- a/target-mips/mips-defs.h
+++ b/target-mips/mips-defs.h
@@ -1,5 +1,5 @@
-#if !defined (__QEMU_MIPS_DEFS_H__)
-#define __QEMU_MIPS_DEFS_H__
+#ifndef QEMU_MIPS_DEFS_H
+#define QEMU_MIPS_DEFS_H
 
 /* If we want to use host float regs... */
 //#define USE_HOST_FLOAT_REGS
@@ -88,4 +88,4 @@
    Note that we still maintain Count/Compare to match the host clock. */
 //#define MIPS_STRICT_STANDARD 1
 
-#endif /* !defined (__QEMU_MIPS_DEFS_H__) */
+#endif /* QEMU_MIPS_DEFS_H */
diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
index 8fdfa5c..8d38828 100644
--- a/target-ppc/helper_regs.h
+++ b/target-ppc/helper_regs.h
@@ -17,8 +17,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#if !defined(__HELPER_REGS_H__)
-#define __HELPER_REGS_H__
+#ifndef HELPER_REGS_H
+#define HELPER_REGS_H
 
 /* Swap temporary saved registers with GPRs */
 static inline void hreg_swap_gpr_tgpr(CPUPPCState *env)
@@ -168,4 +168,4 @@ static inline void check_tlb_flush(CPUPPCState *env)
 static inline void check_tlb_flush(CPUPPCState *env) { }
 #endif
 
-#endif /* !defined(__HELPER_REGS_H__) */
+#endif /* HELPER_REGS_H */
diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index 20bfb59..5461d10 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -6,8 +6,8 @@
  *
  */
 
-#ifndef __KVM_PPC_H__
-#define __KVM_PPC_H__
+#ifndef KVM_PPC_H
+#define KVM_PPC_H
 
 #define TYPE_HOST_POWERPC_CPU "host-" TYPE_POWERPC_CPU
 
@@ -316,4 +316,4 @@ static inline void kvmppc_icbi_range(PowerPCCPU *cpu, uint8_t *addr, int len)
 #define KVM_INTERRUPT_SET_LEVEL -3
 #endif
 
-#endif /* __KVM_PPC_H__ */
+#endif /* KVM_PPC_H */
diff --git a/target-ppc/mmu-hash32.h b/target-ppc/mmu-hash32.h
index aaceacd..5b9fb08 100644
--- a/target-ppc/mmu-hash32.h
+++ b/target-ppc/mmu-hash32.h
@@ -1,5 +1,5 @@
-#if !defined (__MMU_HASH32_H__)
-#define __MMU_HASH32_H__
+#ifndef MMU_HASH32_H
+#define MMU_HASH32_H
 
 #ifndef CONFIG_USER_ONLY
 
@@ -109,4 +109,4 @@ typedef struct {
 
 #endif /* CONFIG_USER_ONLY */
 
-#endif /* __MMU_HASH32_H__ */
+#endif /* MMU_HASH32_H */
diff --git a/target-ppc/mmu-hash64.h b/target-ppc/mmu-hash64.h
index 3a7476b..db265e3 100644
--- a/target-ppc/mmu-hash64.h
+++ b/target-ppc/mmu-hash64.h
@@ -1,5 +1,5 @@
-#if !defined (__MMU_HASH64_H__)
-#define __MMU_HASH64_H__
+#ifndef MMU_HASH64_H
+#define MMU_HASH64_H
 
 #ifndef CONFIG_USER_ONLY
 
@@ -134,4 +134,4 @@ typedef struct {
 
 #endif /* CONFIG_USER_ONLY */
 
-#endif /* !defined (__MMU_HASH64_H__) */
+#endif /* MMU_HASH64_H */
diff --git a/target-tricore/tricore-defs.h b/target-tricore/tricore-defs.h
index 4350b03..40abfaa 100644
--- a/target-tricore/tricore-defs.h
+++ b/target-tricore/tricore-defs.h
@@ -15,8 +15,8 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#if !defined(__QEMU_TRICORE_DEFS_H__)
-#define __QEMU_TRICORE_DEFS_H__
+#ifndef QEMU_TRICORE_DEFS_H
+#define QEMU_TRICORE_DEFS_H
 
 #define TARGET_PAGE_BITS 14
 #define TARGET_LONG_BITS 32
@@ -25,4 +25,4 @@
 
 #define TRICORE_TLB_MAX 128
 
-#endif /* __QEMU_TRICORE_DEFS_H__ */
+#endif /* QEMU_TRICORE_DEFS_H */
diff --git a/tests/boot-sector.h b/tests/boot-sector.h
index 38be029..f64b477 100644
--- a/tests/boot-sector.h
+++ b/tests/boot-sector.h
@@ -11,8 +11,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef TEST_BOOT_SECTOR
-#define TEST_BOOT_SECTOR
+#ifndef TEST_BOOT_SECTOR_H
+#define TEST_BOOT_SECTOR_H
 
 /* Create boot disk file.  */
 int boot_sector_init(const char *fname);
@@ -23,4 +23,4 @@ void boot_sector_test(void);
 /* unlink boot disk file.  */
 void boot_sector_cleanup(const char *fname);
 
-#endif /* TEST_BOOT_SECTOR */
+#endif /* TEST_BOOT_SECTOR_H */
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index 71dd7a6..c69fb5a 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -1,5 +1,5 @@
-#ifndef __libqos_ahci_h
-#define __libqos_ahci_h
+#ifndef LIBQOS_AHCI_H
+#define LIBQOS_AHCI_H
 
 /*
  * AHCI qtest library functions and definitions
diff --git a/tests/libqos/libqos-pc.h b/tests/libqos/libqos-pc.h
index b1820c5..a0e4c45 100644
--- a/tests/libqos/libqos-pc.h
+++ b/tests/libqos/libqos-pc.h
@@ -1,5 +1,5 @@
-#ifndef __libqos_pc_h
-#define __libqos_pc_h
+#ifndef LIBQOS_PC_H
+#define LIBQOS_PC_H
 
 #include "libqos/libqos.h"
 
diff --git a/tests/libqos/libqos.h b/tests/libqos/libqos.h
index ca14d2e..604980d 100644
--- a/tests/libqos/libqos.h
+++ b/tests/libqos/libqos.h
@@ -1,5 +1,5 @@
-#ifndef __libqos_h
-#define __libqos_h
+#ifndef LIBQOS_H
+#define LIBQOS_H
 
 #include "libqtest.h"
 #include "libqos/pci.h"
diff --git a/ui/keymaps.h b/ui/keymaps.h
index a7600d5..47d0613 100644
--- a/ui/keymaps.h
+++ b/ui/keymaps.h
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef __QEMU_KEYMAPS_H__
-#define __QEMU_KEYMAPS_H__
+#ifndef QEMU_KEYMAPS_H
+#define QEMU_KEYMAPS_H
 
 #include "qemu-common.h"
 
@@ -74,4 +74,4 @@ int keysym2scancode(void *kbd_layout, int keysym);
 int keycode_is_keypad(void *kbd_layout, int keycode);
 int keysym_is_numlock(void *kbd_layout, int keysym);
 
-#endif /* __QEMU_KEYMAPS_H__ */
+#endif /* QEMU_KEYMAPS_H */
diff --git a/ui/sdl_zoom.h b/ui/sdl_zoom.h
index 74955bc..39696dd 100644
--- a/ui/sdl_zoom.h
+++ b/ui/sdl_zoom.h
@@ -11,8 +11,8 @@
  *
  */
 
-#ifndef SDL_zoom_h
-#define SDL_zoom_h
+#ifndef SDL_ZOOM_H
+#define SDL_ZOOM_H
 
 #include <SDL.h>
 
@@ -22,4 +22,4 @@
 int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc,
                   int smooth, SDL_Rect *src_rect);
 
-#endif /* SDL_zoom_h */
+#endif /* SDL_ZOOM_H */
diff --git a/ui/vnc-auth-sasl.h b/ui/vnc-auth-sasl.h
index 3f59da6..cb42745 100644
--- a/ui/vnc-auth-sasl.h
+++ b/ui/vnc-auth-sasl.h
@@ -22,10 +22,8 @@
  * THE SOFTWARE.
  */
 
-
-#ifndef __QEMU_VNC_AUTH_SASL_H__
-#define __QEMU_VNC_AUTH_SASL_H__
-
+#ifndef QEMU_VNC_AUTH_SASL_H
+#define QEMU_VNC_AUTH_SASL_H
 
 #include <sasl/sasl.h>
 
@@ -71,5 +69,4 @@ long vnc_client_write_sasl(VncState *vs);
 
 void start_auth_sasl(VncState *vs);
 
-#endif /* __QEMU_VNC_AUTH_SASL_H__ */
-
+#endif /* QEMU_VNC_AUTH_SASL_H */
diff --git a/ui/vnc-auth-vencrypt.h b/ui/vnc-auth-vencrypt.h
index 9f674c5..1e35406 100644
--- a/ui/vnc-auth-vencrypt.h
+++ b/ui/vnc-auth-vencrypt.h
@@ -24,10 +24,9 @@
  * THE SOFTWARE.
  */
 
-
-#ifndef __QEMU_VNC_AUTH_VENCRYPT_H__
-#define __QEMU_VNC_AUTH_VENCRYPT_H__
+#ifndef QEMU_VNC_AUTH_VENCRYPT_H
+#define QEMU_VNC_AUTH_VENCRYPT_H
 
 void start_auth_vencrypt(VncState *vs);
 
-#endif /* __QEMU_VNC_AUTH_VENCRYPT_H__ */
+#endif /* QEMU_VNC_AUTH_VENCRYPT_H */
diff --git a/ui/vnc-ws.h b/ui/vnc-ws.h
index 652b6fc..396cacf 100644
--- a/ui/vnc-ws.h
+++ b/ui/vnc-ws.h
@@ -18,8 +18,8 @@
  * along with this software; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __QEMU_UI_VNC_WS_H
-#define __QEMU_UI_VNC_WS_H
+#ifndef QEMU_UI_VNC_WS_H
+#define QEMU_UI_VNC_WS_H
 
 gboolean vncws_tls_handshake_io(QIOChannel *ioc,
                                 GIOCondition condition,
@@ -28,4 +28,4 @@ gboolean vncws_handshake_io(QIOChannel *ioc,
                             GIOCondition condition,
                             void *opaque);
 
-#endif /* __QEMU_UI_VNC_WS_H */
+#endif /* QEMU_UI_VNC_WS_H */
diff --git a/ui/vnc.h b/ui/vnc.h
index 6568bca..ab5f244 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -24,8 +24,8 @@
  * THE SOFTWARE.
  */
 
-#ifndef __QEMU_VNC_H
-#define __QEMU_VNC_H
+#ifndef QEMU_VNC_H
+#define QEMU_VNC_H
 
 #include "qemu-common.h"
 #include "qemu/queue.h"
@@ -577,4 +577,4 @@ int vnc_zrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
 int vnc_zywrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
 void vnc_zrle_clear(VncState *vs);
 
-#endif /* __QEMU_VNC_H */
+#endif /* QEMU_VNC_H */
-- 
2.5.5

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

* [Qemu-devel] [PULL 17/18] Clean up decorations and whitespace around header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (15 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 16/18] Clean up ill-advised or unusual header guards Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 14:31 ` [Qemu-devel] [PULL 18/18] cris: Fix broken header guard in hw/cris/boot.h Markus Armbruster
  2016-07-12 16:21 ` [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Peter Maydell
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Cleaned up with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 audio/audio.h                     | 3 ++-
 audio/audio_int.h                 | 3 ++-
 audio/audio_pt_int.h              | 2 +-
 audio/mixeng.h                    | 3 ++-
 bsd-user/i386/target_syscall.h    | 2 +-
 bsd-user/sparc/target_syscall.h   | 2 +-
 bsd-user/sparc64/target_syscall.h | 2 +-
 bsd-user/x86_64/target_syscall.h  | 2 +-
 hw/audio/gusemu.h                 | 2 +-
 hw/audio/gustate.h                | 2 +-
 hw/audio/lm4549.h                 | 2 +-
 hw/audio/pl041.h                  | 2 +-
 hw/display/qxl.h                  | 2 +-
 hw/display/vga_int.h              | 3 ++-
 hw/intc/gic_internal.h            | 2 +-
 hw/intc/gicv3_internal.h          | 2 +-
 hw/lm32/lm32.h                    | 2 +-
 hw/net/ne2000.h                   | 2 +-
 hw/net/pcnet.h                    | 2 +-
 hw/pci-bridge/xio3130_upstream.h  | 2 +-
 hw/s390x/s390-virtio.h            | 2 +-
 hw/xen/xen-host-pci-device.h      | 2 +-
 hw/xen/xen_pt.h                   | 2 +-
 hw/xenpv/xen_domainbuild.h        | 2 +-
 include/block/blockjob.h          | 3 ++-
 include/block/thread-pool.h       | 2 +-
 include/exec/cpu-common.h         | 4 ++--
 include/exec/gen-icount.h         | 2 +-
 include/exec/helper-gen.h         | 2 +-
 include/exec/helper-proto.h       | 2 +-
 include/exec/helper-tcg.h         | 2 +-
 include/exec/softmmu-semi.h       | 3 ++-
 include/fpu/softfloat.h           | 2 +-
 include/hw/acpi/acpi.h            | 3 ++-
 include/hw/arm/pxa.h              | 5 +++--
 include/hw/arm/soc_dma.h          | 3 +--
 include/hw/audio/pcspk.h          | 2 +-
 include/hw/block/flash.h          | 2 +-
 include/hw/bt.h                   | 2 +-
 include/hw/char/escc.h            | 2 +-
 include/hw/char/lm32_juart.h      | 2 +-
 include/hw/char/serial.h          | 3 ++-
 include/hw/cris/etraxfs_dma.h     | 2 +-
 include/hw/display/dpcd.h         | 2 +-
 include/hw/dma/xlnx_dpdma.h       | 2 +-
 include/hw/empty_slot.h           | 2 +-
 include/hw/fw-path-provider.h     | 2 +-
 include/hw/i2c/pm_smbus.h         | 2 +-
 include/hw/i386/apic_internal.h   | 3 ++-
 include/hw/i386/ioapic.h          | 2 +-
 include/hw/i386/ioapic_internal.h | 2 +-
 include/hw/input/ps2.h            | 2 +-
 include/hw/isa/i8257.h            | 1 -
 include/hw/isa/i8259_internal.h   | 2 +-
 include/hw/nmi.h                  | 2 +-
 include/hw/pci/pci_bridge.h       | 2 +-
 include/hw/pci/pci_ids.h          | 3 ++-
 include/hw/pcmcia.h               | 2 +-
 include/hw/platform-bus.h         | 4 ++--
 include/hw/ppc/mac_dbdma.h        | 3 ++-
 include/hw/ppc/ppc.h              | 2 +-
 include/hw/smbios/smbios.h        | 3 ++-
 include/hw/stream.h               | 2 +-
 include/hw/sysbus.h               | 4 ++--
 include/hw/timer/i8254.h          | 2 +-
 include/hw/timer/i8254_internal.h | 2 +-
 include/hw/timer/mc146818rtc.h    | 2 +-
 include/hw/unicore32/puv3.h       | 3 ++-
 include/hw/usb/ehci-regs.h        | 2 +-
 include/hw/usb/uhci-regs.h        | 2 +-
 include/hw/vfio/vfio-common.h     | 3 ++-
 include/hw/vfio/vfio-platform.h   | 2 +-
 include/hw/watchdog/wdt_diag288.h | 2 +-
 include/hw/xen/xen.h              | 3 ++-
 include/hw/xen/xen_backend.h      | 2 +-
 include/hw/xen/xen_common.h       | 4 +---
 include/migration/qemu-file.h     | 4 +++-
 include/migration/vmstate.h       | 3 ++-
 include/monitor/monitor.h         | 2 +-
 include/qemu/bcd.h                | 2 +-
 include/qemu/cutils.h             | 2 +-
 include/qemu/fprintf-fn.h         | 3 +--
 include/qemu/hbitmap.h            | 2 +-
 include/qemu/help_option.h        | 2 +-
 include/qemu/host-utils.h         | 3 ++-
 include/qemu/id.h                 | 2 +-
 include/qemu/main-loop.h          | 2 +-
 include/qemu/path.h               | 2 +-
 include/qemu/ratelimit.h          | 2 +-
 include/qemu/rcu_queue.h          | 2 +-
 include/qemu/readline.h           | 2 +-
 include/qemu/seqlock.h            | 3 ++-
 include/qemu/unicode.h            | 2 +-
 include/sysemu/xen-mapcache.h     | 3 +--
 include/trace-tcg.h               | 2 +-
 include/trace.h                   | 2 +-
 linux-user/uname.h                | 4 ++--
 net/tap-linux.h                   | 2 +-
 slirp/bootp.h                     | 3 ++-
 slirp/main.h                      | 3 ++-
 slirp/tftp.h                      | 3 ++-
 target-cris/crisv32-decode.h      | 3 ++-
 target-tricore/cpu-qom.h          | 2 +-
 tcg/tci/tcg-target.h              | 3 +--
 trace/control-internal.h          | 4 +---
 trace/control.h                   | 2 +-
 trace/event-internal.h            | 2 +-
 trace/ftrace.h                    | 4 +---
 trace/mem-internal.h              | 2 +-
 trace/mem.h                       | 2 +-
 ui/curses_keys.h                  | 2 +-
 111 files changed, 140 insertions(+), 126 deletions(-)

diff --git a/audio/audio.h b/audio/audio.h
index b41a970..11e56c9 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef QEMU_AUDIO_H
 #define QEMU_AUDIO_H
 
@@ -162,4 +163,4 @@ static inline void *advance (void *p, int incr)
 int wav_start_capture (CaptureState *s, const char *path, int freq,
                        int bits, int nchannels);
 
-#endif  /* audio.h */
+#endif /* QEMU_AUDIO_H */
diff --git a/audio/audio_int.h b/audio/audio_int.h
index 566df5e..5bcb1c6 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef QEMU_AUDIO_INT_H
 #define QEMU_AUDIO_INT_H
 
@@ -257,4 +258,4 @@ static inline int audio_ring_dist (int dst, int src, int len)
 #define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__)
 #endif
 
-#endif /* audio_int.h */
+#endif /* QEMU_AUDIO_INT_H */
diff --git a/audio/audio_pt_int.h b/audio/audio_pt_int.h
index 0dfff76..4c0c15b 100644
--- a/audio/audio_pt_int.h
+++ b/audio/audio_pt_int.h
@@ -19,4 +19,4 @@ int audio_pt_wait (struct audio_pt *, const char *);
 int audio_pt_unlock_and_signal (struct audio_pt *, const char *);
 int audio_pt_join (struct audio_pt *, void **, const char *);
 
-#endif /* audio_pt_int.h */
+#endif /* QEMU_AUDIO_PT_INT_H */
diff --git a/audio/mixeng.h b/audio/mixeng.h
index 9de443b..b53a5ef 100644
--- a/audio/mixeng.h
+++ b/audio/mixeng.h
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef QEMU_MIXENG_H
 #define QEMU_MIXENG_H
 
@@ -48,4 +49,4 @@ void st_rate_stop (void *opaque);
 void mixeng_clear (struct st_sample *buf, int len);
 void mixeng_volume (struct st_sample *buf, int len, struct mixeng_volume *vol);
 
-#endif  /* mixeng.h */
+#endif /* QEMU_MIXENG_H */
diff --git a/bsd-user/i386/target_syscall.h b/bsd-user/i386/target_syscall.h
index 82d1c58..8f20138 100644
--- a/bsd-user/i386/target_syscall.h
+++ b/bsd-user/i386/target_syscall.h
@@ -162,4 +162,4 @@ struct target_vm86plus_struct {
 
 #define UNAME_MACHINE "i386"
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* TARGET_SYSCALL_H */
diff --git a/bsd-user/sparc/target_syscall.h b/bsd-user/sparc/target_syscall.h
index c7eec6b..dfdf9f8 100644
--- a/bsd-user/sparc/target_syscall.h
+++ b/bsd-user/sparc/target_syscall.h
@@ -11,4 +11,4 @@ struct target_pt_regs {
 
 #define UNAME_MACHINE "sun4"
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* TARGET_SYSCALL_H */
diff --git a/bsd-user/sparc64/target_syscall.h b/bsd-user/sparc64/target_syscall.h
index 2f06100..3a9f4c2 100644
--- a/bsd-user/sparc64/target_syscall.h
+++ b/bsd-user/sparc64/target_syscall.h
@@ -12,4 +12,4 @@ struct target_pt_regs {
 
 #define UNAME_MACHINE "sun4u"
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* TARGET_SYSCALL_H */
diff --git a/bsd-user/x86_64/target_syscall.h b/bsd-user/x86_64/target_syscall.h
index 85a9766..211ce29 100644
--- a/bsd-user/x86_64/target_syscall.h
+++ b/bsd-user/x86_64/target_syscall.h
@@ -118,4 +118,4 @@ struct target_msqid64_ds {
 #define TARGET_ARCH_GET_FS 0x1003
 #define TARGET_ARCH_GET_GS 0x1004
 
-#endif  /* TARGET_SYSCALL_H */
+#endif /* TARGET_SYSCALL_H */
diff --git a/hw/audio/gusemu.h b/hw/audio/gusemu.h
index b7f0751..9aec7bf 100644
--- a/hw/audio/gusemu.h
+++ b/hw/audio/gusemu.h
@@ -101,4 +101,4 @@ void gus_irqgen(GUSEmuState *state, unsigned int elapsed_time);
 /* lower values won´t provide any benefit at all, higher values can cause audible timing delays */
 /* note: masked timers are also calculated by this function, thus it might be needed even without any IRQs in use! */
 
-#endif  /* gusemu.h */
+#endif /* GUSEMU_H */
diff --git a/hw/audio/gustate.h b/hw/audio/gustate.h
index ece903a..d162971 100644
--- a/hw/audio/gustate.h
+++ b/hw/audio/gustate.h
@@ -129,4 +129,4 @@
 
 #define gusdataend (VSRegsEnd+4)
 
-#endif  /* gustate.h */
+#endif /* GUSTATE_H */
diff --git a/hw/audio/lm4549.h b/hw/audio/lm4549.h
index 812a7a4..74c3ee8 100644
--- a/hw/audio/lm4549.h
+++ b/hw/audio/lm4549.h
@@ -40,4 +40,4 @@ uint32_t lm4549_read(lm4549_state *s, hwaddr offset);
 void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value);
 uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right);
 
-#endif /* #ifndef HW_LM4549_H */
+#endif /* HW_LM4549_H */
diff --git a/hw/audio/pl041.h b/hw/audio/pl041.h
index 427ab6d..515db47 100644
--- a/hw/audio/pl041.h
+++ b/hw/audio/pl041.h
@@ -132,4 +132,4 @@ enum {
 #define RXTOFEC3     (1 << 11)
 #define RXTOFEC4     (1 << 12)
 
-#endif /* #ifndef HW_PL041_H */
+#endif /* HW_PL041_H */
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index fdb619d..d2d49dd 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -1,5 +1,5 @@
 #ifndef HW_QXL_H
-#define HW_QXL_H 1
+#define HW_QXL_H
 
 #include "qemu-common.h"
 
diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 29a5c03..dd6c958 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -21,8 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef HW_VGA_INT_H
-#define HW_VGA_INT_H 1
+#define HW_VGA_INT_H
 
 #include "hw/hw.h"
 #include "exec/memory.h"
diff --git a/hw/intc/gic_internal.h b/hw/intc/gic_internal.h
index 20c1e8a..3f31174 100644
--- a/hw/intc/gic_internal.h
+++ b/hw/intc/gic_internal.h
@@ -100,4 +100,4 @@ static inline bool gic_test_pending(GICState *s, int irq, int cm)
     }
 }
 
-#endif /* !QEMU_ARM_GIC_INTERNAL_H */
+#endif /* QEMU_ARM_GIC_INTERNAL_H */
diff --git a/hw/intc/gicv3_internal.h b/hw/intc/gicv3_internal.h
index 6ce5d49..8f3567e 100644
--- a/hw/intc/gicv3_internal.h
+++ b/hw/intc/gicv3_internal.h
@@ -328,4 +328,4 @@ static inline void gicv3_cache_all_target_cpustates(GICv3State *s)
     }
 }
 
-#endif /* !QEMU_ARM_GIC_INTERNAL_H */
+#endif /* QEMU_ARM_GICV3_INTERNAL_H */
diff --git a/hw/lm32/lm32.h b/hw/lm32/lm32.h
index e338bfe..db9eb29 100644
--- a/hw/lm32/lm32.h
+++ b/hw/lm32/lm32.h
@@ -1,5 +1,5 @@
 #ifndef HW_LM32_H
-#define HW_LM32_H 1
+#define HW_LM32_H
 
 #include "hw/char/lm32_juart.h"
 
diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h
index d022b28..d213dcc 100644
--- a/hw/net/ne2000.h
+++ b/hw/net/ne2000.h
@@ -1,5 +1,5 @@
 #ifndef HW_NE2000_H
-#define HW_NE2000_H 1
+#define HW_NE2000_H
 
 #define NE2000_PMEM_SIZE    (32*1024)
 #define NE2000_PMEM_START   (16*1024)
diff --git a/hw/net/pcnet.h b/hw/net/pcnet.h
index dec8de8..40831a7 100644
--- a/hw/net/pcnet.h
+++ b/hw/net/pcnet.h
@@ -1,5 +1,5 @@
 #ifndef HW_PCNET_H
-#define HW_PCNET_H 1
+#define HW_PCNET_H
 
 #define PCNET_IOPORT_SIZE       0x20
 #define PCNET_PNPMMIO_SIZE      0x20
diff --git a/hw/pci-bridge/xio3130_upstream.h b/hw/pci-bridge/xio3130_upstream.h
index 08c1d5f..d0ab757 100644
--- a/hw/pci-bridge/xio3130_upstream.h
+++ b/hw/pci-bridge/xio3130_upstream.h
@@ -7,4 +7,4 @@ PCIEPort *xio3130_upstream_init(PCIBus *bus, int devfn, bool multifunction,
                                 const char *bus_name, pci_map_irq_fn map_irq,
                                 uint8_t port);
 
-#endif /* QEMU_XIO3130_H */
+#endif /* QEMU_XIO3130_UPSTREAM_H */
diff --git a/hw/s390x/s390-virtio.h b/hw/s390x/s390-virtio.h
index ffd014c..f588b80 100644
--- a/hw/s390x/s390-virtio.h
+++ b/hw/s390x/s390-virtio.h
@@ -10,7 +10,7 @@
  */
 
 #ifndef HW_S390_VIRTIO_H
-#define HW_S390_VIRTIO_H 1
+#define HW_S390_VIRTIO_H
 
 #include "hw/nmi.h"
 #include "standard-headers/asm-s390/kvm_virtio.h"
diff --git a/hw/xen/xen-host-pci-device.h b/hw/xen/xen-host-pci-device.h
index 6acf36e..4d8d34e 100644
--- a/hw/xen/xen-host-pci-device.h
+++ b/hw/xen/xen-host-pci-device.h
@@ -55,4 +55,4 @@ int xen_host_pci_set_block(XenHostPCIDevice *d, int pos, uint8_t *buf,
 
 int xen_host_pci_find_ext_cap_offset(XenHostPCIDevice *s, uint32_t cap);
 
-#endif /* !XEN_HOST_PCI_DEVICE_H_ */
+#endif /* XEN_HOST_PCI_DEVICE_H */
diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index c2f8e1f..191d9ca 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -332,4 +332,4 @@ int xen_pt_register_vga_regions(XenHostPCIDevice *dev);
 int xen_pt_unregister_vga_regions(XenHostPCIDevice *dev);
 void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev,
                      Error **errp);
-#endif /* !XEN_PT_H */
+#endif /* XEN_PT_H */
diff --git a/hw/xenpv/xen_domainbuild.h b/hw/xenpv/xen_domainbuild.h
index 29a91ea..652d9b4 100644
--- a/hw/xenpv/xen_domainbuild.h
+++ b/hw/xenpv/xen_domainbuild.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_HW_XEN_DOMAINBUILD_H
-#define QEMU_HW_XEN_DOMAINBUILD_H 1
+#define QEMU_HW_XEN_DOMAINBUILD_H
 
 #include "hw/xen/xen_common.h"
 
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 7dc720c..f7f5687 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef BLOCKJOB_H
-#define BLOCKJOB_H 1
+#define BLOCKJOB_H
 
 #include "block/block.h"
 
diff --git a/include/block/thread-pool.h b/include/block/thread-pool.h
index 42eb5e8..7dd7d73 100644
--- a/include/block/thread-pool.h
+++ b/include/block/thread-pool.h
@@ -16,7 +16,7 @@
  */
 
 #ifndef QEMU_THREAD_POOL_H
-#define QEMU_THREAD_POOL_H 1
+#define QEMU_THREAD_POOL_H
 
 #include "block/block.h"
 
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 9ac1eaf..952bcfe 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -1,5 +1,5 @@
 #ifndef CPU_COMMON_H
-#define CPU_COMMON_H 1
+#define CPU_COMMON_H
 
 /* CPU interfaces that are target independent.  */
 
@@ -117,4 +117,4 @@ int qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque);
 
 #endif
 
-#endif /* !CPU_COMMON_H */
+#endif /* CPU_COMMON_H */
diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
index a011324..1af03d8 100644
--- a/include/exec/gen-icount.h
+++ b/include/exec/gen-icount.h
@@ -1,5 +1,5 @@
 #ifndef GEN_ICOUNT_H
-#define GEN_ICOUNT_H 1
+#define GEN_ICOUNT_H
 
 #include "qemu/timer.h"
 
diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h
index be96254..8239ffc 100644
--- a/include/exec/helper-gen.h
+++ b/include/exec/helper-gen.h
@@ -2,7 +2,7 @@
    This one expands generation functions for tcg opcodes.  */
 
 #ifndef HELPER_GEN_H
-#define HELPER_GEN_H 1
+#define HELPER_GEN_H
 
 #include "exec/helper-head.h"
 
diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h
index 0090137..954bef8 100644
--- a/include/exec/helper-proto.h
+++ b/include/exec/helper-proto.h
@@ -2,7 +2,7 @@
    This one expands prototypes for the helper functions.  */
 
 #ifndef HELPER_PROTO_H
-#define HELPER_PROTO_H 1
+#define HELPER_PROTO_H
 
 #include "exec/helper-head.h"
 
diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h
index 62d87a3..bb92877 100644
--- a/include/exec/helper-tcg.h
+++ b/include/exec/helper-tcg.h
@@ -2,7 +2,7 @@
    This one defines data structures private to tcg.c.  */
 
 #ifndef HELPER_TCG_H
-#define HELPER_TCG_H 1
+#define HELPER_TCG_H
 
 #include "exec/helper-head.h"
 
diff --git a/include/exec/softmmu-semi.h b/include/exec/softmmu-semi.h
index 3a58c3f..7eefad8 100644
--- a/include/exec/softmmu-semi.h
+++ b/include/exec/softmmu-semi.h
@@ -6,8 +6,9 @@
  *
  * This code is licensed under the GPL
  */
+
 #ifndef SOFTMMU_SEMI_H
-#define SOFTMMU_SEMI_H 1
+#define SOFTMMU_SEMI_H
 
 static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
 {
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 95a1103..0e57ee5 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -751,4 +751,4 @@ static inline int float128_is_any_nan(float128 a)
 *----------------------------------------------------------------------------*/
 float128 float128_default_nan(float_status *status);
 
-#endif /* !SOFTFLOAT_H */
+#endif /* SOFTFLOAT_H */
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index c717f15..7b3d93c 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -1,5 +1,6 @@
 #ifndef QEMU_HW_ACPI_H
 #define QEMU_HW_ACPI_H
+
 /*
  *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
  *                     VA Linux Systems Japan K.K.
@@ -188,4 +189,4 @@ struct AcpiSlicOem {
 };
 int acpi_get_slic_oem(AcpiSlicOem *oem);
 
-#endif /* !QEMU_HW_ACPI_H */
+#endif /* QEMU_HW_ACPI_H */
diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h
index 074feac..dd1a48b 100644
--- a/include/hw/arm/pxa.h
+++ b/include/hw/arm/pxa.h
@@ -6,8 +6,9 @@
  *
  * This code is licensed under the GNU GPL v2.
  */
+
 #ifndef PXA_H
-# define PXA_H			"pxa.h"
+#define PXA_H
 
 #include "exec/memory.h"
 #include "target-arm/cpu-qom.h"
@@ -189,4 +190,4 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size,
                          const char *revision);
 PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size);
 
-#endif	/* PXA_H */
+#endif /* PXA_H */
diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h
index 7379731..fae3229 100644
--- a/include/hw/arm/soc_dma.h
+++ b/include/hw/arm/soc_dma.h
@@ -19,8 +19,7 @@
  */
 
 #ifndef HW_SOC_DMA_H
-#define HW_SOC_DMA_H 1
-
+#define HW_SOC_DMA_H
 
 #include "exec/memory.h"
 #include "hw/irq.h"
diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 33e46a5..172afbf 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -44,4 +44,4 @@ static inline ISADevice *pcspk_init(ISABus *bus, ISADevice *pit)
     return isadev;
 }
 
-#endif /* !HW_PCSPK_H */
+#endif /* HW_PCSPK_H */
diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h
index a088baa..67c3aa3 100644
--- a/include/hw/block/flash.h
+++ b/include/hw/block/flash.h
@@ -1,5 +1,5 @@
 #ifndef HW_FLASH_H
-#define HW_FLASH_H 1
+#define HW_FLASH_H
 
 /* NOR flash devices */
 
diff --git a/include/hw/bt.h b/include/hw/bt.h
index c7c7909..185e79d 100644
--- a/include/hw/bt.h
+++ b/include/hw/bt.h
@@ -24,7 +24,7 @@
  */
 
 #ifndef HW_BT_H
-#define HW_BT_H 1
+#define HW_BT_H
 
 #include "hw/irq.h"
 
diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h
index 2742d70..297e2eb 100644
--- a/include/hw/char/escc.h
+++ b/include/hw/char/escc.h
@@ -1,5 +1,5 @@
 #ifndef HW_ESCC_H
-#define HW_ESCC_H 1
+#define HW_ESCC_H
 
 /* escc.c */
 #define TYPE_ESCC "escc"
diff --git a/include/hw/char/lm32_juart.h b/include/hw/char/lm32_juart.h
index 70dc416..e7c6fb5 100644
--- a/include/hw/char/lm32_juart.h
+++ b/include/hw/char/lm32_juart.h
@@ -10,4 +10,4 @@ uint32_t lm32_juart_get_jrx(DeviceState *d);
 void lm32_juart_set_jtx(DeviceState *d, uint32_t jtx);
 void lm32_juart_set_jrx(DeviceState *d, uint32_t jrx);
 
-#endif /* QEMU_HW_LM32_JUART_H */
+#endif /* QEMU_HW_CHAR_LM32_JUART_H */
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 9feddc6..a4fd3d5 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef HW_SERIAL_H
-#define HW_SERIAL_H 1
+#define HW_SERIAL_H
 
 #include "hw/hw.h"
 #include "sysemu/sysemu.h"
diff --git a/include/hw/cris/etraxfs_dma.h b/include/hw/cris/etraxfs_dma.h
index 38104a6..f6f33e0 100644
--- a/include/hw/cris/etraxfs_dma.h
+++ b/include/hw/cris/etraxfs_dma.h
@@ -1,5 +1,5 @@
 #ifndef HW_ETRAXFS_DMA_H
-#define HW_ETRAXFS_DMA_H 1
+#define HW_ETRAXFS_DMA_H
 
 struct dma_context_metadata {
 	/* data descriptor md */
diff --git a/include/hw/display/dpcd.h b/include/hw/display/dpcd.h
index 274dc2e..6880ee3 100644
--- a/include/hw/display/dpcd.h
+++ b/include/hw/display/dpcd.h
@@ -102,4 +102,4 @@ typedef struct DPCDState DPCDState;
 #define DPCD_SINK_STATUS                        0x205
 #define DPCD_RECEIVE_PORT_0_STATUS              0x01
 
-#endif /* !DPCD_H */
+#endif /* DPCD_H */
diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h
index ae571a0..664df28 100644
--- a/include/hw/dma/xlnx_dpdma.h
+++ b/include/hw/dma/xlnx_dpdma.h
@@ -82,4 +82,4 @@ void xlnx_dpdma_set_host_data_location(XlnxDPDMAState *s, uint8_t channel,
  */
 void xlnx_dpdma_trigger_vsync_irq(XlnxDPDMAState *s);
 
-#endif /* !XLNX_DPDMA_H */
+#endif /* XLNX_DPDMA_H */
diff --git a/include/hw/empty_slot.h b/include/hw/empty_slot.h
index 6079602..123a9f8 100644
--- a/include/hw/empty_slot.h
+++ b/include/hw/empty_slot.h
@@ -1,5 +1,5 @@
 #ifndef HW_EMPTY_SLOT_H
-#define HW_EMPTY_SLOT_H 1
+#define HW_EMPTY_SLOT_H
 
 /* empty_slot.c */
 void empty_slot_init(hwaddr addr, uint64_t slot_size);
diff --git a/include/hw/fw-path-provider.h b/include/hw/fw-path-provider.h
index 7afaec0..050cb05 100644
--- a/include/hw/fw-path-provider.h
+++ b/include/hw/fw-path-provider.h
@@ -16,7 +16,7 @@
  */
 
 #ifndef FW_PATH_PROVIDER_H
-#define FW_PATH_PROVIDER_H 1
+#define FW_PATH_PROVIDER_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
diff --git a/include/hw/i2c/pm_smbus.h b/include/hw/i2c/pm_smbus.h
index 926603f..2a837af 100644
--- a/include/hw/i2c/pm_smbus.h
+++ b/include/hw/i2c/pm_smbus.h
@@ -17,4 +17,4 @@ typedef struct PMSMBus {
 
 void pm_smbus_init(DeviceState *parent, PMSMBus *smb);
 
-#endif /* !PM_SMBUS_H */
+#endif /* PM_SMBUS_H */
diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 74fe935..73ce716 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -17,6 +17,7 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
+
 #ifndef QEMU_APIC_INTERNAL_H
 #define QEMU_APIC_INTERNAL_H
 
@@ -222,4 +223,4 @@ static inline int apic_get_bit(uint32_t *tab, int index)
     return !!(tab[i] & mask);
 }
 
-#endif /* !QEMU_APIC_INTERNAL_H */
+#endif /* QEMU_APIC_INTERNAL_H */
diff --git a/include/hw/i386/ioapic.h b/include/hw/i386/ioapic.h
index 6245388..9c8816f 100644
--- a/include/hw/i386/ioapic.h
+++ b/include/hw/i386/ioapic.h
@@ -25,4 +25,4 @@
 
 void ioapic_eoi_broadcast(int vector);
 
-#endif /* !HW_IOAPIC_H */
+#endif /* HW_IOAPIC_H */
diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h
index cab9e67..0542aa1 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -112,4 +112,4 @@ void ioapic_reset_common(DeviceState *dev);
 
 void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s);
 
-#endif /* !QEMU_IOAPIC_INTERNAL_H */
+#endif /* QEMU_IOAPIC_INTERNAL_H */
diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h
index 7c45ce7..b9ceee4 100644
--- a/include/hw/input/ps2.h
+++ b/include/hw/input/ps2.h
@@ -35,4 +35,4 @@ void ps2_queue(void *, int b);
 void ps2_keyboard_set_translation(void *opaque, int mode);
 void ps2_mouse_fake_event(void *opaque);
 
-#endif /* !HW_PS2_H */
+#endif /* HW_PS2_H */
diff --git a/include/hw/isa/i8257.h b/include/hw/isa/i8257.h
index 8c44d36..aa211c0 100644
--- a/include/hw/isa/i8257.h
+++ b/include/hw/isa/i8257.h
@@ -39,4 +39,3 @@ typedef struct I8257State {
 } I8257State;
 
 #endif
-
diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_internal.h
index cded509..6954b6e 100644
--- a/include/hw/isa/i8259_internal.h
+++ b/include/hw/isa/i8259_internal.h
@@ -80,4 +80,4 @@ void pic_reset_common(PICCommonState *s);
 ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master);
 
 
-#endif /* !QEMU_I8259_INTERNAL_H */
+#endif /* QEMU_I8259_INTERNAL_H */
diff --git a/include/hw/nmi.h b/include/hw/nmi.h
index b541772..d092c68 100644
--- a/include/hw/nmi.h
+++ b/include/hw/nmi.h
@@ -20,7 +20,7 @@
  */
 
 #ifndef NMI_H
-#define NMI_H 1
+#define NMI_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h
index ed4aff6..847fd7d 100644
--- a/include/hw/pci/pci_bridge.h
+++ b/include/hw/pci/pci_bridge.h
@@ -67,4 +67,4 @@ void pci_bridge_map_irq(PCIBridge *br, const char* bus_name,
 #define  PCI_BRIDGE_CTL_DISCARD_STATUS	0x400	/* Discard timer status */
 #define  PCI_BRIDGE_CTL_DISCARD_SERR	0x800	/* Discard timer SERR# enable */
 
-#endif  /* QEMU_PCI_BRIDGE_H */
+#endif /* QEMU_PCI_BRIDGE_H */
diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h
index db85afa..d77ca60 100644
--- a/include/hw/pci/pci_ids.h
+++ b/include/hw/pci/pci_ids.h
@@ -7,8 +7,9 @@
  *
  *      QEMU-specific definitions belong in pci.h
  */
+
 #ifndef HW_PCI_IDS_H
-#define HW_PCI_IDS_H 1
+#define HW_PCI_IDS_H
 
 /* Device classes and subclasses */
 
diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h
index 98406ff..79cac9c 100644
--- a/include/hw/pcmcia.h
+++ b/include/hw/pcmcia.h
@@ -1,5 +1,5 @@
 #ifndef HW_PCMCIA_H
-#define HW_PCMCIA_H 1
+#define HW_PCMCIA_H
 
 /* PCMCIA/Cardbus */
 
diff --git a/include/hw/platform-bus.h b/include/hw/platform-bus.h
index bd42b83..a00775c 100644
--- a/include/hw/platform-bus.h
+++ b/include/hw/platform-bus.h
@@ -1,5 +1,5 @@
 #ifndef HW_PLATFORM_BUS_H
-#define HW_PLATFORM_BUS_H 1
+#define HW_PLATFORM_BUS_H
 
 /*
  *  Platform Bus device to support dynamic Sysbus devices
@@ -54,4 +54,4 @@ int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev,
 hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
                                   int n);
 
-#endif /* !HW_PLATFORM_BUS_H */
+#endif /* HW_PLATFORM_BUS_H */
diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h
index d15a6cc..a860387 100644
--- a/include/hw/ppc/mac_dbdma.h
+++ b/include/hw/ppc/mac_dbdma.h
@@ -19,8 +19,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef HW_MAC_DBDMA_H
-#define HW_MAC_DBDMA_H 1
+#define HW_MAC_DBDMA_H
 
 #include "exec/memory.h"
 #include "qemu/iov.h"
diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h
index 5617dc4..520c72a 100644
--- a/include/hw/ppc/ppc.h
+++ b/include/hw/ppc/ppc.h
@@ -1,5 +1,5 @@
 #ifndef HW_PPC_H
-#define HW_PPC_H 1
+#define HW_PPC_H
 
 #include "target-ppc/cpu-qom.h"
 
diff --git a/include/hw/smbios/smbios.h b/include/hw/smbios/smbios.h
index ba36746..1cd53cc 100644
--- a/include/hw/smbios/smbios.h
+++ b/include/hw/smbios/smbios.h
@@ -1,5 +1,6 @@
 #ifndef QEMU_SMBIOS_H
 #define QEMU_SMBIOS_H
+
 /*
  * SMBIOS Support
  *
@@ -266,4 +267,4 @@ void smbios_get_tables(const struct smbios_phys_mem_area *mem_array,
                        const unsigned int mem_array_size,
                        uint8_t **tables, size_t *tables_len,
                        uint8_t **anchor, size_t *anchor_len);
-#endif /*QEMU_SMBIOS_H */
+#endif /* QEMU_SMBIOS_H */
diff --git a/include/hw/stream.h b/include/hw/stream.h
index 30ccc56..c370ba0 100644
--- a/include/hw/stream.h
+++ b/include/hw/stream.h
@@ -1,5 +1,5 @@
 #ifndef STREAM_H
-#define STREAM_H 1
+#define STREAM_H
 
 #include "qemu-common.h"
 #include "qom/object.h"
diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h
index a495937..e73a5b2 100644
--- a/include/hw/sysbus.h
+++ b/include/hw/sysbus.h
@@ -1,5 +1,5 @@
 #ifndef HW_SYSBUS_H
-#define HW_SYSBUS_H 1
+#define HW_SYSBUS_H
 
 /* Devices attached directly to the main system bus.  */
 
@@ -118,4 +118,4 @@ static inline DeviceState *sysbus_try_create_simple(const char *name,
     return sysbus_try_create_varargs(name, addr, irq, NULL);
 }
 
-#endif /* !HW_SYSBUS_H */
+#endif /* HW_SYSBUS_H */
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 27a0fb6..5adae9f 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -80,4 +80,4 @@ static inline ISADevice *kvm_pit_init(ISABus *bus, int base)
 void pit_set_gate(ISADevice *dev, int channel, int val);
 void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *info);
 
-#endif /* !HW_I8254_H */
+#endif /* HW_I8254_H */
diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h
index e7cb757..dc09cc0 100644
--- a/include/hw/timer/i8254_internal.h
+++ b/include/hw/timer/i8254_internal.h
@@ -73,4 +73,4 @@ void pit_get_channel_info_common(PITCommonState *s, PITChannelState *sc,
                                  PITChannelInfo *info);
 void pit_reset_common(PITCommonState *s);
 
-#endif /* !QEMU_I8254_INTERNAL_H */
+#endif /* QEMU_I8254_INTERNAL_H */
diff --git a/include/hw/timer/mc146818rtc.h b/include/hw/timer/mc146818rtc.h
index eaf6497..7c8e64b 100644
--- a/include/hw/timer/mc146818rtc.h
+++ b/include/hw/timer/mc146818rtc.h
@@ -10,4 +10,4 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
 void rtc_set_memory(ISADevice *dev, int addr, int val);
 int rtc_get_memory(ISADevice *dev, int addr);
 
-#endif /* !MC146818RTC_H */
+#endif /* MC146818RTC_H */
diff --git a/include/hw/unicore32/puv3.h b/include/hw/unicore32/puv3.h
index f37adcb..5a4839f 100644
--- a/include/hw/unicore32/puv3.h
+++ b/include/hw/unicore32/puv3.h
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation, or any later version.
  * See the COPYING file in the top-level directory.
  */
+
 #ifndef QEMU_HW_PUV3_H
 #define QEMU_HW_PUV3_H
 
@@ -46,4 +47,4 @@
 #define DPRINTF(fmt, ...) do {} while (0)
 #endif
 
-#endif /* !QEMU_HW_PUV3_H */
+#endif /* QEMU_HW_PUV3_H */
diff --git a/include/hw/usb/ehci-regs.h b/include/hw/usb/ehci-regs.h
index 616f1b8..3e91b8e 100644
--- a/include/hw/usb/ehci-regs.h
+++ b/include/hw/usb/ehci-regs.h
@@ -1,5 +1,5 @@
 #ifndef HW_USB_EHCI_REGS_H
-#define HW_USB_EHCI_REGS_H 1
+#define HW_USB_EHCI_REGS_H
 
 /* Capability Registers Base Address - section 2.2 */
 #define CAPLENGTH        0x0000  /* 1-byte, 0x0001 reserved */
diff --git a/include/hw/usb/uhci-regs.h b/include/hw/usb/uhci-regs.h
index c7315c5..fd45d29 100644
--- a/include/hw/usb/uhci-regs.h
+++ b/include/hw/usb/uhci-regs.h
@@ -1,5 +1,5 @@
 #ifndef HW_USB_UHCI_REGS_H
-#define HW_USB_UHCI_REGS_H 1
+#define HW_USB_UHCI_REGS_H
 
 #define UHCI_CMD_FGR      (1 << 4)
 #define UHCI_CMD_EGSM     (1 << 3)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 07f7188..94dfae3 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -17,6 +17,7 @@
  *  Copyright (C) 2008, Red Hat, Amit Shah (amit.shah@redhat.com)
  *  Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com)
  */
+
 #ifndef HW_VFIO_VFIO_COMMON_H
 #define HW_VFIO_VFIO_COMMON_H
 
@@ -174,4 +175,4 @@ int vfio_spapr_create_window(VFIOContainer *container,
 int vfio_spapr_remove_window(VFIOContainer *container,
                              hwaddr offset_within_address_space);
 
-#endif /* !HW_VFIO_VFIO_COMMON_H */
+#endif /* HW_VFIO_VFIO_COMMON_H */
diff --git a/include/hw/vfio/vfio-platform.h b/include/hw/vfio/vfio-platform.h
index b468f80..9baaa2db 100644
--- a/include/hw/vfio/vfio-platform.h
+++ b/include/hw/vfio/vfio-platform.h
@@ -74,4 +74,4 @@ typedef struct VFIOPlatformDeviceClass {
 #define VFIO_PLATFORM_DEVICE_GET_CLASS(obj) \
      OBJECT_GET_CLASS(VFIOPlatformDeviceClass, (obj), TYPE_VFIO_PLATFORM)
 
-#endif /*HW_VFIO_VFIO_PLATFORM_H*/
+#endif /* HW_VFIO_VFIO_PLATFORM_H */
diff --git a/include/hw/watchdog/wdt_diag288.h b/include/hw/watchdog/wdt_diag288.h
index 7f3fd45..706d96b 100644
--- a/include/hw/watchdog/wdt_diag288.h
+++ b/include/hw/watchdog/wdt_diag288.h
@@ -33,4 +33,4 @@ typedef struct DIAG288Class {
                         uint64_t func, uint64_t timeout);
 } DIAG288Class;
 
-#endif  /* WDT_DIAG288_H */
+#endif /* WDT_DIAG288_H */
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index b2cd992..a8f3afb 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -1,5 +1,6 @@
 #ifndef QEMU_HW_XEN_H
-#define QEMU_HW_XEN_H 1
+#define QEMU_HW_XEN_H
+
 /*
  * public xen header
  *   stuff needed outside xen-*.c, i.e. interfaces to qemu.
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 6e18a46..754c0a4 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_HW_XEN_BACKEND_H
-#define QEMU_HW_XEN_BACKEND_H 1
+#define QEMU_HW_XEN_BACKEND_H
 
 #include "hw/xen/xen_common.h"
 #include "sysemu/sysemu.h"
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 5eabf37..640c31e 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -1,7 +1,5 @@
 #ifndef QEMU_HW_XEN_COMMON_H
-#define QEMU_HW_XEN_COMMON_H 1
-
-
+#define QEMU_HW_XEN_COMMON_H
 
 /*
  * If we have new enough libxenctrl then we do not want/need these compat
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index 2409a98..abedd46 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -21,8 +21,10 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef QEMU_FILE_H
-#define QEMU_FILE_H 1
+#define QEMU_FILE_H
+
 #include "qemu-common.h"
 #include "exec/cpu-common.h"
 #include "io/channel.h"
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 8e31b9b..1638ee5 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -23,8 +23,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef QEMU_VMSTATE_H
-#define QEMU_VMSTATE_H 1
+#define QEMU_VMSTATE_H
 
 #ifndef CONFIG_USER_ONLY
 #include "migration/qemu-file.h"
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index aa0f373..c5c9ea2 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -51,4 +51,4 @@ int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd);
 void monitor_fdset_dup_fd_remove(int dup_fd);
 int monitor_fdset_dup_fd_find(int dup_fd);
 
-#endif /* !MONITOR_H */
+#endif /* MONITOR_H */
diff --git a/include/qemu/bcd.h b/include/qemu/bcd.h
index b4c9b64..dfebacf 100644
--- a/include/qemu/bcd.h
+++ b/include/qemu/bcd.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_BCD_H
-#define QEMU_BCD_H 1
+#define QEMU_BCD_H
 
 /* Convert a byte between binary and BCD.  */
 static inline uint8_t to_bcd(uint8_t val)
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index db7adad..3e4ea23 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_CUTILS_H
-#define QEMU_CUTILS_H 1
+#define QEMU_CUTILS_H
 
 #include "qemu/fprintf-fn.h"
 
diff --git a/include/qemu/fprintf-fn.h b/include/qemu/fprintf-fn.h
index b6bad35..9068a96 100644
--- a/include/qemu/fprintf-fn.h
+++ b/include/qemu/fprintf-fn.h
@@ -6,8 +6,7 @@
  */
 
 #ifndef QEMU_FPRINTF_FN_H
-#define QEMU_FPRINTF_FN_H 1
-
+#define QEMU_FPRINTF_FN_H
 
 typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index e29188c..8ab721e 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -10,7 +10,7 @@
  */
 
 #ifndef HBITMAP_H
-#define HBITMAP_H 1
+#define HBITMAP_H
 
 #include "bitops.h"
 #include "host-utils.h"
diff --git a/include/qemu/help_option.h b/include/qemu/help_option.h
index e39a66e..328d2a8 100644
--- a/include/qemu/help_option.h
+++ b/include/qemu/help_option.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_HELP_OPTION_H
-#define QEMU_HELP_OPTION_H 1
+#define QEMU_HELP_OPTION_H
 
 /**
  * is_help_option:
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 3de7d4e..46187bb 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -22,8 +22,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #ifndef HOST_UTILS_H
-#define HOST_UTILS_H 1
+#define HOST_UTILS_H
 
 #include "qemu/bswap.h"
 
diff --git a/include/qemu/id.h b/include/qemu/id.h
index 7d90335..40c7010 100644
--- a/include/qemu/id.h
+++ b/include/qemu/id.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_ID_H
-#define QEMU_ID_H 1
+#define QEMU_ID_H
 
 typedef enum IdSubSystems {
     ID_QDEV,
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index 19b5de3..3fa7cfe 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -23,7 +23,7 @@
  */
 
 #ifndef QEMU_MAIN_LOOP_H
-#define QEMU_MAIN_LOOP_H 1
+#define QEMU_MAIN_LOOP_H
 
 #include "block/aio.h"
 
diff --git a/include/qemu/path.h b/include/qemu/path.h
index ed5fee0..c6292a9 100644
--- a/include/qemu/path.h
+++ b/include/qemu/path.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_PATH_H
-#define QEMU_PATH_H 1
+#define QEMU_PATH_H
 
 void init_paths(const char *prefix);
 const char *path(const char *pathname);
diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h
index d413a4a..1e3cb13 100644
--- a/include/qemu/ratelimit.h
+++ b/include/qemu/ratelimit.h
@@ -12,7 +12,7 @@
  */
 
 #ifndef QEMU_RATELIMIT_H
-#define QEMU_RATELIMIT_H 1
+#define QEMU_RATELIMIT_H
 
 typedef struct {
     int64_t next_slice_time;
diff --git a/include/qemu/rcu_queue.h b/include/qemu/rcu_queue.h
index 3aca7a5..01be774 100644
--- a/include/qemu/rcu_queue.h
+++ b/include/qemu/rcu_queue.h
@@ -131,4 +131,4 @@ extern "C" {
 #ifdef __cplusplus
 }
 #endif
-#endif /* QEMU_RCU_QUEUE.H */
+#endif /* QEMU_RCU_QUEUE_H */
diff --git a/include/qemu/readline.h b/include/qemu/readline.h
index 49efe4e..c08cf74 100644
--- a/include/qemu/readline.h
+++ b/include/qemu/readline.h
@@ -60,4 +60,4 @@ ReadLineState *readline_init(ReadLinePrintfFunc *printf_func,
                              void *opaque,
                              ReadLineCompletionFunc *completion_finder);
 
-#endif /* !READLINE_H */
+#endif /* READLINE_H */
diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h
index 18eb3fd..2e2be4c 100644
--- a/include/qemu/seqlock.h
+++ b/include/qemu/seqlock.h
@@ -10,8 +10,9 @@
  * See the COPYING file in the top-level directory.
  *
  */
+
 #ifndef QEMU_SEQLOCK_H
-#define QEMU_SEQLOCK_H 1
+#define QEMU_SEQLOCK_H
 
 #include "qemu/atomic.h"
 #include "qemu/thread.h"
diff --git a/include/qemu/unicode.h b/include/qemu/unicode.h
index d873165..71c72db 100644
--- a/include/qemu/unicode.h
+++ b/include/qemu/unicode.h
@@ -1,5 +1,5 @@
 #ifndef QEMU_UNICODE_H
-#define QEMU_UNICODE_H 1
+#define QEMU_UNICODE_H
 
 int mod_utf8_codepoint(const char *s, size_t n, char **end);
 
diff --git a/include/sysemu/xen-mapcache.h b/include/sysemu/xen-mapcache.h
index c849489..b8c93b9 100644
--- a/include/sysemu/xen-mapcache.h
+++ b/include/sysemu/xen-mapcache.h
@@ -9,7 +9,6 @@
 #ifndef XEN_MAPCACHE_H
 #define XEN_MAPCACHE_H
 
-
 typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr start_addr,
                                                      ram_addr_t size,
                                                      void *opaque);
@@ -52,4 +51,4 @@ static inline void xen_invalidate_map_cache(void)
 
 #endif
 
-#endif /* !XEN_MAPCACHE_H */
+#endif /* XEN_MAPCACHE_H */
diff --git a/include/trace-tcg.h b/include/trace-tcg.h
index 6f6bdbb..edab4b1 100644
--- a/include/trace-tcg.h
+++ b/include/trace-tcg.h
@@ -4,4 +4,4 @@
 #include "trace/generated-tcg-tracers.h"
 #include "trace/generated-events.h"
 
-#endif  /* TRACE_TCG_H */
+#endif /* TRACE_TCG_H */
diff --git a/include/trace.h b/include/trace.h
index 44a1f1f..9a01e44 100644
--- a/include/trace.h
+++ b/include/trace.h
@@ -4,4 +4,4 @@
 #include "trace/generated-tracers.h"
 #include "trace/generated-events.h"
 
-#endif  /* TRACE_H */
+#endif /* TRACE_H */
diff --git a/linux-user/uname.h b/linux-user/uname.h
index cc62e76..4503094 100644
--- a/linux-user/uname.h
+++ b/linux-user/uname.h
@@ -1,5 +1,5 @@
 #ifndef UNAME_H
-#define UNAME_H 1
+#define UNAME_H
 
 #include <sys/utsname.h>
 #include <linux/utsname.h>
@@ -7,4 +7,4 @@
 const char *cpu_to_uname_machine(void *cpu_env);
 int sys_uname(struct new_utsname *buf);
 
-#endif /* UNAME _H */
+#endif /* UNAME_H */
diff --git a/net/tap-linux.h b/net/tap-linux.h
index 1dc3a9f..2f36d10 100644
--- a/net/tap-linux.h
+++ b/net/tap-linux.h
@@ -50,4 +50,4 @@
 #define TUN_F_TSO_ECN	0x08	/* I can handle TSO with ECN bits. */
 #define TUN_F_UFO	0x10	/* I can handle UFO packets */
 
-#endif /* QEMU_TAP_H */
+#endif /* QEMU_TAP_LINUX_H */
diff --git a/slirp/bootp.h b/slirp/bootp.h
index ec3b687..3945257 100644
--- a/slirp/bootp.h
+++ b/slirp/bootp.h
@@ -1,6 +1,7 @@
 /* bootp/dhcp defines */
+
 #ifndef SLIRP_BOOTP_H
-#define SLIRP_BOOTP_H 1
+#define SLIRP_BOOTP_H
 
 #define BOOTP_SERVER	67
 #define BOOTP_CLIENT	68
diff --git a/slirp/main.h b/slirp/main.h
index f2e58cf..90053ce 100644
--- a/slirp/main.h
+++ b/slirp/main.h
@@ -4,8 +4,9 @@
  * Please read the file COPYRIGHT for the
  * terms and conditions of the copyright.
  */
+
 #ifndef SLIRP_MAIN_H
-#define SLIRP_MAIN_H 1
+#define SLIRP_MAIN_H
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
diff --git a/slirp/tftp.h b/slirp/tftp.h
index 1cb1adf..2cd276d 100644
--- a/slirp/tftp.h
+++ b/slirp/tftp.h
@@ -1,6 +1,7 @@
 /* tftp defines */
+
 #ifndef SLIRP_TFTP_H
-#define SLIRP_TFTP_H 1
+#define SLIRP_TFTP_H
 
 #define TFTP_SESSIONS_MAX 20
 
diff --git a/target-cris/crisv32-decode.h b/target-cris/crisv32-decode.h
index cdba377..cdc2f8c 100644
--- a/target-cris/crisv32-decode.h
+++ b/target-cris/crisv32-decode.h
@@ -17,8 +17,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #ifndef CRISV32_DECODE_H
-#define CRISV32_DECODE_H 1
+#define CRISV32_DECODE_H
 
 /* Convenient binary macros.  */
 #define HEX__(n) 0x##n##LU
diff --git a/target-tricore/cpu-qom.h b/target-tricore/cpu-qom.h
index 399c98f..6a69756 100644
--- a/target-tricore/cpu-qom.h
+++ b/target-tricore/cpu-qom.h
@@ -41,4 +41,4 @@ typedef struct TriCoreCPUClass {
 
 typedef struct TriCoreCPU TriCoreCPU;
 
-#endif /*QEMU_TRICORE_CPU_QOM_H */
+#endif /* QEMU_TRICORE_CPU_QOM_H */
diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h
index 3942f9c..868228b 100644
--- a/tcg/tci/tcg-target.h
+++ b/tcg/tci/tcg-target.h
@@ -37,10 +37,9 @@
  * Therefore, we need both 32 and 64 bit virtual machines (interpreter).
  */
 
-#if !defined(TCG_TARGET_H)
+#ifndef TCG_TARGET_H
 #define TCG_TARGET_H
 
-
 #define TCG_TARGET_INTERPRETER 1
 #define TCG_TARGET_INSN_UNIT_SIZE 1
 #define TCG_TARGET_TLB_DISPLACEMENT_BITS 32
diff --git a/trace/control-internal.h b/trace/control-internal.h
index dcf67f5..deacc8f 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -10,8 +10,6 @@
 #ifndef TRACE__CONTROL_INTERNAL_H
 #define TRACE__CONTROL_INTERNAL_H
 
-
-
 extern TraceEvent trace_events[];
 extern bool trace_events_dstate[];
 extern int trace_events_enabled_count;
@@ -72,4 +70,4 @@ static inline void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
     trace_events_dstate[id] = state;
 }
 
-#endif  /* TRACE__CONTROL_INTERNAL_H */
+#endif /* TRACE__CONTROL_INTERNAL_H */
diff --git a/trace/control.h b/trace/control.h
index a2dd3ea..452a800 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -203,4 +203,4 @@ char *trace_opt_parse(const char *optarg);
 
 #include "trace/control-internal.h"
 
-#endif  /* TRACE__CONTROL_H */
+#endif /* TRACE__CONTROL_H */
diff --git a/trace/event-internal.h b/trace/event-internal.h
index 86f6a51..e4ea2e7 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -28,4 +28,4 @@ typedef struct TraceEvent {
 } TraceEvent;
 
 
-#endif  /* TRACE__EVENT_INTERNAL_H */
+#endif /* TRACE__EVENT_INTERNAL_H */
diff --git a/trace/ftrace.h b/trace/ftrace.h
index 92372e3..cb5e35d 100644
--- a/trace/ftrace.h
+++ b/trace/ftrace.h
@@ -1,8 +1,6 @@
 #ifndef TRACE_FTRACE_H
 #define TRACE_FTRACE_H
 
-
-
 #define MAX_TRACE_STRLEN 512
 #define _STR(x) #x
 #define STR(x) _STR(x)
@@ -11,4 +9,4 @@ extern int trace_marker_fd;
 
 bool ftrace_init(void);
 
-#endif /* ! TRACE_FTRACE_H */
+#endif /* TRACE_FTRACE_H */
diff --git a/trace/mem-internal.h b/trace/mem-internal.h
index a75e0ff..ddda934 100644
--- a/trace/mem-internal.h
+++ b/trace/mem-internal.h
@@ -43,4 +43,4 @@ static inline uint8_t trace_mem_build_info(
     return res;
 }
 
-#endif  /* TRACE__MEM_INTERNAL_H */
+#endif /* TRACE__MEM_INTERNAL_H */
diff --git a/trace/mem.h b/trace/mem.h
index c76a572..9c88bcb 100644
--- a/trace/mem.h
+++ b/trace/mem.h
@@ -31,4 +31,4 @@ static uint8_t trace_mem_build_info(TCGMemOp size, bool sign_extend,
 
 #include "trace/mem-internal.h"
 
-#endif  /* TRACE__MEM_H */
+#endif /* TRACE__MEM_H */
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index f746744..e39ef9e 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -23,7 +23,7 @@
  */
 
 #ifndef QEMU_CURSES_KEYS_H
-#define QEMU_CURSES_KEYS_H 1
+#define QEMU_CURSES_KEYS_H
 
 #include <curses.h>
 #include "keymaps.h"
-- 
2.5.5

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

* [Qemu-devel] [PULL 18/18] cris: Fix broken header guard in hw/cris/boot.h
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (16 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 17/18] Clean up decorations and whitespace around " Markus Armbruster
@ 2016-07-12 14:31 ` Markus Armbruster
  2016-07-12 16:21 ` [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Peter Maydell
  18 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-12 14:31 UTC (permalink / raw)
  To: qemu-devel

Found with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 hw/cris/boot.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/cris/boot.h b/hw/cris/boot.h
index c4d3fa6..218854e 100644
--- a/hw/cris/boot.h
+++ b/hw/cris/boot.h
@@ -1,5 +1,5 @@
-#ifndef _CRIS_BOOT_H
-#define HW_CRIS_BOOT_H 1
+#ifndef HW_CRIS_BOOT_H
+#define HW_CRIS_BOOT_H
 
 struct cris_load_info
 {
-- 
2.5.5

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

* Re: [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards
  2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
                   ` (17 preceding siblings ...)
  2016-07-12 14:31 ` [Qemu-devel] [PULL 18/18] cris: Fix broken header guard in hw/cris/boot.h Markus Armbruster
@ 2016-07-12 16:21 ` Peter Maydell
  2016-07-13  7:26   ` Markus Armbruster
  18 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2016-07-12 16:21 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

On 12 July 2016 at 15:31, Markus Armbruster <armbru@redhat.com> wrote:
> The following changes since commit b35399bb4e9968296a12303b00f9f2066470e987:
>
>   Fix confusing argument names in some common functions (2016-07-12 13:06:08 +0100)
>
> are available in the git repository at:
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-include-2016-07-12
>
> for you to fetch changes up to 82751a32be872e71c22167234ac88ba52bf96a37:
>
>   cris: Fix broken header guard in hw/cris/boot.h (2016-07-12 16:20:46 +0200)
>
> ----------------------------------------------------------------
> Clean up #include "..." vs <...> and header guards
>
> ----------------------------------------------------------------
> Markus Armbruster (18):
>       Use #include "..." for our own headers, <...> for others
>       scripts: New clean-header-guards.pl
>       target-*: Clean up cpu.h header guards
>       linux-user: Clean up target_syscall.h header guards
>       linux-user: Clean up target_cpu.h header guards
>       linux-user: Clean up target_signal.h header guards
>       linux-user: Clean up target_structs.h header guards
>       linux-user: Clean up hostdep.h header guards
>       linux-user: Fix broken header guard in syscall_defs.h
>       tcg: Clean up tcg-target.h header guards
>       spapr_pci: Include spapr.h instead of playing games with #error
>       Drop Emacs local variables lists redundant with .dir-locals.el
>       Clean up header guards that don't match their file name
>       libdecnumber: Don't fool around with guards to avoid #include
>       libdecnumber: Don't error out on decNumberLocal.h re-inclusion
>       Clean up ill-advised or unusual header guards
>       Clean up decorations and whitespace around header guards
>       cris: Fix broken header guard in hw/cris/boot.h

Applied to master. Thanks for pushing this one through, this
kind of big change can be a real pain to get into the tree...

-- PMM

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

* Re: [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards
  2016-07-12 16:21 ` [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Peter Maydell
@ 2016-07-13  7:26   ` Markus Armbruster
  0 siblings, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2016-07-13  7:26 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> On 12 July 2016 at 15:31, Markus Armbruster <armbru@redhat.com> wrote:
>> The following changes since commit b35399bb4e9968296a12303b00f9f2066470e987:
>>
>>   Fix confusing argument names in some common functions (2016-07-12 13:06:08 +0100)
>>
>> are available in the git repository at:
>>
>>   git://repo.or.cz/qemu/armbru.git tags/pull-include-2016-07-12
>>
>> for you to fetch changes up to 82751a32be872e71c22167234ac88ba52bf96a37:
>>
>>   cris: Fix broken header guard in hw/cris/boot.h (2016-07-12 16:20:46 +0200)
>>
>> ----------------------------------------------------------------
>> Clean up #include "..." vs <...> and header guards
>>
>> ----------------------------------------------------------------
>> Markus Armbruster (18):
>>       Use #include "..." for our own headers, <...> for others
>>       scripts: New clean-header-guards.pl
>>       target-*: Clean up cpu.h header guards
>>       linux-user: Clean up target_syscall.h header guards
>>       linux-user: Clean up target_cpu.h header guards
>>       linux-user: Clean up target_signal.h header guards
>>       linux-user: Clean up target_structs.h header guards
>>       linux-user: Clean up hostdep.h header guards
>>       linux-user: Fix broken header guard in syscall_defs.h
>>       tcg: Clean up tcg-target.h header guards
>>       spapr_pci: Include spapr.h instead of playing games with #error
>>       Drop Emacs local variables lists redundant with .dir-locals.el
>>       Clean up header guards that don't match their file name
>>       libdecnumber: Don't fool around with guards to avoid #include
>>       libdecnumber: Don't error out on decNumberLocal.h re-inclusion
>>       Clean up ill-advised or unusual header guards
>>       Clean up decorations and whitespace around header guards
>>       cris: Fix broken header guard in hw/cris/boot.h
>
> Applied to master. Thanks for pushing this one through, this
> kind of big change can be a real pain to get into the tree...

It can be a real pain to rebase, so thank you for pulling it quickly :)

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

end of thread, other threads:[~2016-07-13  7:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 14:31 [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 01/18] Use #include "..." for our own headers, <...> for others Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 02/18] scripts: New clean-header-guards.pl Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 03/18] target-*: Clean up cpu.h header guards Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 04/18] linux-user: Clean up target_syscall.h " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 05/18] linux-user: Clean up target_cpu.h " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 06/18] linux-user: Clean up target_signal.h " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 07/18] linux-user: Clean up target_structs.h " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 08/18] linux-user: Clean up hostdep.h " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 09/18] linux-user: Fix broken header guard in syscall_defs.h Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 10/18] tcg: Clean up tcg-target.h header guards Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 11/18] spapr_pci: Include spapr.h instead of playing games with #error Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 12/18] Drop Emacs local variables lists redundant with .dir-locals.el Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 13/18] Clean up header guards that don't match their file name Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 14/18] libdecnumber: Don't fool around with guards to avoid #include Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 15/18] libdecnumber: Don't error out on decNumberLocal.h re-inclusion Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 16/18] Clean up ill-advised or unusual header guards Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 17/18] Clean up decorations and whitespace around " Markus Armbruster
2016-07-12 14:31 ` [Qemu-devel] [PULL 18/18] cris: Fix broken header guard in hw/cris/boot.h Markus Armbruster
2016-07-12 16:21 ` [Qemu-devel] [PULL 00/18] Clean up #include "..." vs <...> and header guards Peter Maydell
2016-07-13  7:26   ` Markus Armbruster

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.