From: "Michael S. Tsirkin" <mst@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, imammedo@redhat.com, ani@anisinha.ca,
peter.maydell@linaro.org, laurent@vivier.eu,
edgar.iglesias@gmail.com, Alistair.Francis@wdc.com,
bin.meng@windriver.com, palmer@dabbelt.com,
marcel.apfelbaum@gmail.com, yangxiaojuan@loongson.cn,
gaosong@loongson.cn, richard.henderson@linaro.org, deller@gmx.de,
jasowang@redhat.com, vikram.garhwal@amd.com,
francisco.iglesias@amd.com, clg@kaod.org, kraxel@redhat.com,
marcandre.lureau@redhat.com, riku.voipio@iki.fi,
qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org,
crwulff@gmail.com, marex@denx.de,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Bin Meng" <bmeng.cn@gmail.com>,
"Taylor Simpson" <tsimpson@quicinc.com>
Subject: Re: [PATCH v2 3/4] include: Don't include qemu/osdep.h
Date: Sun, 8 Jan 2023 01:51:03 -0500 [thread overview]
Message-ID: <20230108015023-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20221222120813.727830-4-armbru@redhat.com>
On Thu, Dec 22, 2022 at 01:08:12PM +0100, Markus Armbruster wrote:
> docs/devel/style.rst mandates:
>
> The "qemu/osdep.h" header contains preprocessor macros that affect
> the behavior of core system headers like <stdint.h>. It must be
> the first include so that core system headers included by external
> libraries get the preprocessor macros that QEMU depends on.
>
> Do not include "qemu/osdep.h" from header files since the .c file
> will have already included it.
>
> A few violations have crept in. Fix them.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Dropped this one due to CI failures.
> ---
> bsd-user/qemu.h | 1 -
> crypto/block-luks-priv.h | 1 -
> include/hw/cxl/cxl_host.h | 1 -
> include/hw/input/pl050.h | 1 -
> include/hw/tricore/triboard.h | 1 -
> include/qemu/userfaultfd.h | 1 -
> net/vmnet_int.h | 1 -
> qga/cutils.h | 1 -
> target/hexagon/hex_arch_types.h | 1 -
> target/hexagon/mmvec/macros.h | 1 -
> target/riscv/pmu.h | 1 -
> qga/cutils.c | 3 ++-
> 12 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index be6105385e..0ceecfb6df 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -17,7 +17,6 @@
> #ifndef QEMU_H
> #define QEMU_H
>
> -#include "qemu/osdep.h"
> #include "cpu.h"
> #include "qemu/units.h"
> #include "exec/cpu_ldst.h"
> diff --git a/crypto/block-luks-priv.h b/crypto/block-luks-priv.h
> index dc2dd14e52..8fc967afcb 100644
> --- a/crypto/block-luks-priv.h
> +++ b/crypto/block-luks-priv.h
> @@ -18,7 +18,6 @@
> *
> */
>
> -#include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "qemu/bswap.h"
>
> diff --git a/include/hw/cxl/cxl_host.h b/include/hw/cxl/cxl_host.h
> index a1b662ce40..c9bc9c7c50 100644
> --- a/include/hw/cxl/cxl_host.h
> +++ b/include/hw/cxl/cxl_host.h
> @@ -7,7 +7,6 @@
> * COPYING file in the top-level directory.
> */
>
> -#include "qemu/osdep.h"
> #include "hw/cxl/cxl.h"
> #include "hw/boards.h"
>
> diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h
> index 89ec4fafc9..4cb8985f31 100644
> --- a/include/hw/input/pl050.h
> +++ b/include/hw/input/pl050.h
> @@ -10,7 +10,6 @@
> #ifndef HW_PL050_H
> #define HW_PL050_H
>
> -#include "qemu/osdep.h"
> #include "hw/sysbus.h"
> #include "migration/vmstate.h"
> #include "hw/input/ps2.h"
> diff --git a/include/hw/tricore/triboard.h b/include/hw/tricore/triboard.h
> index 094c8bd563..4fdd2d7d97 100644
> --- a/include/hw/tricore/triboard.h
> +++ b/include/hw/tricore/triboard.h
> @@ -18,7 +18,6 @@
> * License along with this library; if not, see <http://www.gnu.org/licenses/>.
> */
>
> -#include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "hw/boards.h"
> #include "sysemu/sysemu.h"
> diff --git a/include/qemu/userfaultfd.h b/include/qemu/userfaultfd.h
> index 6b74f92792..55c95998e8 100644
> --- a/include/qemu/userfaultfd.h
> +++ b/include/qemu/userfaultfd.h
> @@ -13,7 +13,6 @@
> #ifndef USERFAULTFD_H
> #define USERFAULTFD_H
>
> -#include "qemu/osdep.h"
> #include "exec/hwaddr.h"
> #include <linux/userfaultfd.h>
>
> diff --git a/net/vmnet_int.h b/net/vmnet_int.h
> index adf6e8c20d..d0b90594f2 100644
> --- a/net/vmnet_int.h
> +++ b/net/vmnet_int.h
> @@ -10,7 +10,6 @@
> #ifndef VMNET_INT_H
> #define VMNET_INT_H
>
> -#include "qemu/osdep.h"
> #include "vmnet_int.h"
> #include "clients.h"
>
> diff --git a/qga/cutils.h b/qga/cutils.h
> index f0f30a7d28..2bfaf554a8 100644
> --- a/qga/cutils.h
> +++ b/qga/cutils.h
> @@ -1,7 +1,6 @@
> #ifndef CUTILS_H_
> #define CUTILS_H_
>
> -#include "qemu/osdep.h"
>
> int qga_open_cloexec(const char *name, int flags, mode_t mode);
>
> diff --git a/target/hexagon/hex_arch_types.h b/target/hexagon/hex_arch_types.h
> index 885f68f760..52a7f2b2f3 100644
> --- a/target/hexagon/hex_arch_types.h
> +++ b/target/hexagon/hex_arch_types.h
> @@ -18,7 +18,6 @@
> #ifndef HEXAGON_HEX_ARCH_TYPES_H
> #define HEXAGON_HEX_ARCH_TYPES_H
>
> -#include "qemu/osdep.h"
> #include "mmvec/mmvec.h"
> #include "qemu/int128.h"
>
> diff --git a/target/hexagon/mmvec/macros.h b/target/hexagon/mmvec/macros.h
> index 8c864e8c68..1201d778d0 100644
> --- a/target/hexagon/mmvec/macros.h
> +++ b/target/hexagon/mmvec/macros.h
> @@ -18,7 +18,6 @@
> #ifndef HEXAGON_MMVEC_MACROS_H
> #define HEXAGON_MMVEC_MACROS_H
>
> -#include "qemu/osdep.h"
> #include "qemu/host-utils.h"
> #include "arch.h"
> #include "mmvec/system_ext_mmvec.h"
> diff --git a/target/riscv/pmu.h b/target/riscv/pmu.h
> index 3004ce37b6..0c819ca983 100644
> --- a/target/riscv/pmu.h
> +++ b/target/riscv/pmu.h
> @@ -16,7 +16,6 @@
> * this program. If not, see <http://www.gnu.org/licenses/>.
> */
>
> -#include "qemu/osdep.h"
> #include "qemu/log.h"
> #include "cpu.h"
> #include "qemu/main-loop.h"
> diff --git a/qga/cutils.c b/qga/cutils.c
> index b8e142ef64..b21bcf3683 100644
> --- a/qga/cutils.c
> +++ b/qga/cutils.c
> @@ -2,8 +2,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 "cutils.h"
>
> +#include "qemu/osdep.h"
> +#include "cutils.h"
> #include "qapi/error.h"
>
> /**
> --
> 2.38.1
next prev parent reply other threads:[~2023-01-08 6:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 12:08 [PATCH v2 0/4] Clean up includes Markus Armbruster
2022-12-22 12:08 ` [PATCH v2 1/4] include/hw/virtio: Break inclusion loop Markus Armbruster
2022-12-23 2:58 ` Jason Wang
2022-12-23 3:31 ` Edgar E. Iglesias
2022-12-22 12:08 ` [PATCH v2 2/4] include: Include headers where needed Markus Armbruster
2022-12-22 12:08 ` [PATCH v2 3/4] include: Don't include qemu/osdep.h Markus Armbruster
2023-01-08 6:51 ` Michael S. Tsirkin [this message]
2022-12-22 12:08 ` [PATCH v2 4/4] docs/devel: Rules on #include in headers Markus Armbruster
2022-12-23 10:47 ` Bernhard Beschow
2023-01-09 12:01 ` Markus Armbruster
2022-12-23 23:41 ` Alex Bennée
2022-12-22 12:10 ` [PATCH v2 0/4] Clean up includes Markus Armbruster
2023-01-05 1:50 ` Michael S. Tsirkin
2023-01-08 6:49 ` Michael S. Tsirkin
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=20230108015023-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=Alistair.Francis@wdc.com \
--cc=ani@anisinha.ca \
--cc=armbru@redhat.com \
--cc=bin.meng@windriver.com \
--cc=bmeng.cn@gmail.com \
--cc=clg@kaod.org \
--cc=crwulff@gmail.com \
--cc=deller@gmx.de \
--cc=edgar.iglesias@gmail.com \
--cc=francisco.iglesias@amd.com \
--cc=gaosong@loongson.cn \
--cc=imammedo@redhat.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=laurent@vivier.eu \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=marex@denx.de \
--cc=palmer@dabbelt.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=riku.voipio@iki.fi \
--cc=tsimpson@quicinc.com \
--cc=vikram.garhwal@amd.com \
--cc=yangxiaojuan@loongson.cn \
/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).