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.

After this series, include/hw/ppc and include/hw/pci-host/pnv* conform
to these rules.

It is based on

    [PATCH v2 0/7] include/hw/pci include/hw/cxl: Clean up includes
    [PATCH v2 0/3] block: Clean up includes
    [PATCH v3 0/5] coroutine: Clean up includes

v2:
* PATCH 3: Drop an #include [Cédric]
* PATCH 4: Add it back, because now we actually need it

[1] Message-ID: <87h9g8j57d....@blackfin.pond.sub.org>
    https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html

Based-on: <20221222100330.380143-1-arm...@redhat.com>

Markus Armbruster (4):
  include/hw/ppc: Split pnv_chip.h off pnv.h
  include/hw/ppc: Supply a few missing includes
  include/hw/ppc: Don't include hw/pci-host/pnv_phb.h from pnv.h
  include/hw/ppc include/hw/pci-host: Drop extra typedefs

 hw/pci-host/pnv_phb.h          |   2 +-
 include/hw/pci-host/pnv_phb3.h |   1 -
 include/hw/pci-host/pnv_phb4.h |   5 +-
 include/hw/ppc/pnv.h           | 146 +-------------------------------
 include/hw/ppc/pnv_chip.h      | 147 +++++++++++++++++++++++++++++++++
 include/hw/ppc/pnv_core.h      |   3 +-
 include/hw/ppc/pnv_homer.h     |   2 +-
 include/hw/ppc/pnv_lpc.h       |  11 +--
 include/hw/ppc/pnv_occ.h       |   3 +-
 include/hw/ppc/pnv_pnor.h      |   2 +-
 include/hw/ppc/pnv_sbe.h       |   3 +-
 include/hw/ppc/pnv_xive.h      |   7 +-
 include/hw/ppc/pnv_xscom.h     |   3 +-
 include/hw/ppc/xive2.h         |   2 +
 include/hw/ppc/xive2_regs.h    |   2 +
 hw/intc/pnv_xive.c             |   1 +
 hw/intc/pnv_xive2.c            |   1 +
 hw/pci-host/pnv_phb3.c         |   1 +
 hw/pci-host/pnv_phb4_pec.c     |   1 +
 hw/ppc/pnv.c                   |   3 +
 hw/ppc/pnv_core.c              |   1 +
 hw/ppc/pnv_homer.c             |   1 +
 hw/ppc/pnv_lpc.c               |   1 +
 hw/ppc/pnv_psi.c               |   1 +
 hw/ppc/pnv_xscom.c             |   1 +
 25 files changed, 186 insertions(+), 165 deletions(-)
 create mode 100644 include/hw/ppc/pnv_chip.h

-- 
2.38.1


Reply via email to