qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [Qemu-devel] [PATCH v4 01/29] include: Make headers more self-contained
Date: Mon, 12 Aug 2019 17:58:56 +0200	[thread overview]
Message-ID: <30d9a77b-2197-71ca-30ea-d2eb87d0b601@redhat.com> (raw)
In-Reply-To: <20190812052359.30071-2-armbru@redhat.com>

On 8/12/19 7:23 AM, Markus Armbruster wrote:
> Back in 2016, we discussed[1] rules for headers, and these were
> generally liked:
> 
> 1. Have a carefully curated header that's included everywhere first.  We
>    got that already thanks to Peter: osdep.h.
> 
> 2. Headers should normally include everything they need beyond osdep.h.
>    If exceptions are needed for some reason, they must be documented in
>    the header.  If all that's needed from a header is typedefs, put
>    those into qemu/typedefs.h instead of including the header.
> 
> 3. Cyclic inclusion is forbidden.
> 
> This patch gets include/ closer to obeying 2.
> 
> It's actually extracted from my "[RFC] Baby steps towards saner
> headers" series[2], which demonstrates a possible path towards
> checking 2 automatically.  It passes the RFC test there.
> 
> [1] Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org>
>     https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
> [2] Message-Id: <20190711122827.18970-1-armbru@redhat.com>
>     https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  include/block/raw-aio.h               | 2 ++
>  include/block/write-threshold.h       | 2 ++
>  include/disas/disas.h                 | 1 +
>  include/exec/cputlb.h                 | 3 +++
>  include/exec/exec-all.h               | 1 +
>  include/exec/ioport.h                 | 2 ++
>  include/exec/memory-internal.h        | 2 ++
>  include/exec/ram_addr.h               | 1 +
>  include/exec/softmmu-semi.h           | 2 ++
>  include/exec/tb-hash.h                | 2 ++
>  include/exec/user/thunk.h             | 2 ++
>  include/fpu/softfloat-macros.h        | 2 ++
>  include/hw/acpi/pci.h                 | 3 +++
>  include/hw/acpi/tco.h                 | 3 +++
>  include/hw/adc/stm32f2xx_adc.h        | 2 ++
>  include/hw/arm/allwinner-a10.h        | 1 +
>  include/hw/arm/aspeed_soc.h           | 1 +
>  include/hw/arm/bcm2836.h              | 1 +
>  include/hw/arm/exynos4210.h           | 3 +--
>  include/hw/arm/fsl-imx25.h            | 1 +
>  include/hw/arm/fsl-imx31.h            | 1 +
>  include/hw/arm/sharpsl.h              | 3 +++
>  include/hw/arm/xlnx-zynqmp.h          | 1 +
>  include/hw/block/fdc.h                | 2 ++
>  include/hw/block/flash.h              | 1 +
>  include/hw/char/escc.h                | 1 +
>  include/hw/char/xilinx_uartlite.h     | 2 ++
>  include/hw/core/generic-loader.h      | 1 +
>  include/hw/cris/etraxfs.h             | 1 +
>  include/hw/cris/etraxfs_dma.h         | 3 +++
>  include/hw/display/i2c-ddc.h          | 1 +
>  include/hw/empty_slot.h               | 2 ++
>  include/hw/gpio/bcm2835_gpio.h        | 1 +
>  include/hw/i2c/aspeed_i2c.h           | 2 ++
>  include/hw/i386/apic_internal.h       | 1 +
>  include/hw/i386/ioapic_internal.h     | 1 +
>  include/hw/intc/allwinner-a10-pic.h   | 2 ++
>  include/hw/intc/heathrow_pic.h        | 2 ++
>  include/hw/intc/mips_gic.h            | 1 +
>  include/hw/isa/vt82c686.h             | 2 ++
>  include/hw/mips/cps.h                 | 1 +
>  include/hw/misc/macio/cuda.h          | 2 ++
>  include/hw/misc/macio/gpio.h          | 3 +++
>  include/hw/misc/macio/macio.h         | 2 ++
>  include/hw/misc/macio/pmu.h           | 3 +++
>  include/hw/misc/mips_cmgcr.h          | 2 ++
>  include/hw/misc/mips_cpc.h            | 2 ++
>  include/hw/misc/pvpanic.h             | 3 +++
>  include/hw/net/allwinner_emac.h       | 1 +
>  include/hw/net/lance.h                | 1 +
>  include/hw/nvram/chrp_nvram.h         | 2 ++
>  include/hw/pci-host/sabre.h           | 2 ++
>  include/hw/pci-host/uninorth.h        | 2 +-
>  include/hw/pci/pcie_aer.h             | 1 +
>  include/hw/ppc/pnv_core.h             | 1 +
>  include/hw/ppc/ppc4xx.h               | 4 ++++
>  include/hw/ppc/spapr_irq.h            | 3 +++
>  include/hw/ppc/spapr_vio.h            | 1 +
>  include/hw/ppc/spapr_xive.h           | 2 ++
>  include/hw/ppc/xive_regs.h            | 3 +++
>  include/hw/riscv/boot.h               | 2 ++
>  include/hw/riscv/riscv_hart.h         | 3 +++
>  include/hw/riscv/sifive_clint.h       | 2 ++
>  include/hw/riscv/sifive_e.h           | 1 +
>  include/hw/riscv/sifive_plic.h        | 2 +-
>  include/hw/riscv/sifive_prci.h        | 2 ++
>  include/hw/riscv/sifive_test.h        | 2 ++
>  include/hw/riscv/sifive_u.h           | 1 +
>  include/hw/riscv/sifive_uart.h        | 3 +++
>  include/hw/riscv/spike.h              | 3 +++
>  include/hw/riscv/virt.h               | 3 +++
>  include/hw/s390x/ap-device.h          | 3 +++
>  include/hw/s390x/css-bridge.h         | 3 ++-
>  include/hw/s390x/css.h                | 1 +
>  include/hw/s390x/tod.h                | 2 +-
>  include/hw/semihosting/console.h      | 2 ++
>  include/hw/sh4/sh_intc.h              | 1 +
>  include/hw/sparc/sparc64.h            | 2 ++
>  include/hw/ssi/aspeed_smc.h           | 1 +
>  include/hw/ssi/xilinx_spips.h         | 1 +
>  include/hw/timer/allwinner-a10-pit.h  | 1 +
>  include/hw/timer/i8254_internal.h     | 1 +
>  include/hw/timer/m48t59.h             | 2 ++
>  include/hw/timer/mc146818rtc_regs.h   | 2 ++
>  include/hw/timer/xlnx-zynqmp-rtc.h    | 1 +
>  include/hw/virtio/virtio-access.h     | 1 +
>  include/hw/virtio/virtio-gpu-bswap.h  | 1 +
>  include/hw/virtio/virtio-rng.h        | 1 +
>  include/hw/watchdog/wdt_aspeed.h      | 1 +
>  include/libdecnumber/decNumberLocal.h | 1 +
>  include/migration/cpu.h               | 3 +++
>  include/monitor/hmp-target.h          | 2 ++
>  include/qemu/atomic128.h              | 2 ++
>  include/qemu/ratelimit.h              | 2 ++
>  include/qemu/thread-win32.h           | 2 +-
>  include/sysemu/balloon.h              | 1 +
>  include/sysemu/cryptodev-vhost-user.h | 3 +++
>  include/sysemu/hvf.h                  | 1 +
>  include/sysemu/iothread.h             | 1 +
>  include/sysemu/kvm_int.h              | 2 ++
>  include/sysemu/memory_mapping.h       | 2 ++
>  include/sysemu/xen-mapcache.h         | 2 ++
>  include/ui/egl-helpers.h              | 3 +++
>  include/ui/input.h                    | 1 +
>  include/ui/spice-display.h            | 1 +
>  target/hppa/cpu.h                     | 2 +-
>  106 files changed, 183 insertions(+), 8 deletions(-)


  reply	other threads:[~2019-08-12 16:01 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12  5:23 [Qemu-devel] [PATCH v4 00/29] Tame a few "touch this, recompile the world" headers Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 01/29] include: Make headers more self-contained Markus Armbruster
2019-08-12 15:58   ` Philippe Mathieu-Daudé [this message]
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 02/29] Include generated QAPI headers less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 03/29] qapi: Split error.json off common.json Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 04/29] memory: Fix type of IOMMUMemoryRegionClass member @parent_class Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 05/29] queue: Drop superfluous #include qemu/atomic.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 06/29] trace: Eliminate use of TARGET_FMT_plx Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 07/29] trace: Do not include qom/cpu.h into generated trace.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 08/29] Include sysemu/reset.h a lot less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 09/29] Include migration/qemu-file-types.h " Markus Armbruster
2019-08-12 10:48   ` Philippe Mathieu-Daudé
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 10/29] ide: Include hw/ide/internal a bit less outside hw/ide/ Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 11/29] typedefs: Separate incomplete types and function types Markus Armbruster
2019-08-12 10:55   ` Alex Bennée
2019-08-12 13:37     ` Markus Armbruster
2019-08-13  5:43       ` Markus Armbruster
2019-08-13 10:44         ` Alex Bennée
2019-08-13 11:16           ` Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 12/29] Include hw/irq.h a lot less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 13/29] Clean up inclusion of exec/cpu-common.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 14/29] migration: Move the VMStateDescription typedef to typedefs.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 15/29] Include migration/vmstate.h less Markus Armbruster
2019-08-12 15:59   ` Philippe Mathieu-Daudé
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 16/29] Include exec/memory.h slightly less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 17/29] Include qom/object.h " Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 18/29] Include hw/hw.h exactly where needed Markus Armbruster
2019-08-12 16:01   ` Philippe Mathieu-Daudé
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 19/29] Include qemu/queue.h slightly less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 20/29] Include qemu/main-loop.h less Markus Armbruster
2019-08-12 10:53   ` Alex Bennée
2019-08-12 10:55   ` Philippe Mathieu-Daudé
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 21/29] Include hw/qdev-properties.h less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 22/29] Include hw/boards.h a bit less Markus Armbruster
2019-08-12 16:02   ` Philippe Mathieu-Daudé
2019-08-12 23:35   ` Eduardo Habkost
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 23/29] numa: Don't include hw/boards.h into sysemu/numa.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 24/29] Include sysemu/hostmem.h less Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 25/29] numa: Move remaining NUMA declarations from sysemu.h to numa.h Markus Armbruster
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 26/29] Clean up inclusion of sysemu/sysemu.h Markus Armbruster
2019-08-12 10:10   ` Alex Bennée
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 27/29] Include sysemu/sysemu.h a lot less Markus Armbruster
2019-08-12 10:09   ` Alex Bennée
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 28/29] sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h Markus Armbruster
2019-08-12 10:08   ` Alex Bennée
2019-08-12 13:54     ` Markus Armbruster
2019-08-12 15:00       ` Alex Bennée
2019-08-12 16:06   ` Philippe Mathieu-Daudé
2019-08-12  5:23 ` [Qemu-devel] [PATCH v4 29/29] sysemu: Split sysemu/runstate.h off sysemu/sysemu.h Markus Armbruster
2019-08-12 10:04   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30d9a77b-2197-71ca-30ea-d2eb87d0b601@redhat.com \
    --to=philmd@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).