From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
qemu-block@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Xiao Guangrong" <xiaoguangrong.eric@gmail.com>,
qemu-arm@nongnu.org, "Laszlo Ersek" <lersek@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: [Qemu-devel] [PATCH 10/15] range: Remove Range from "qemu/typedefs.h"
Date: Fri, 11 Jan 2019 15:08:52 +0100 [thread overview]
Message-ID: <20190111140857.4211-11-philmd@redhat.com> (raw)
In-Reply-To: <20190111140857.4211-1-philmd@redhat.com>
Range is only used in "hw/pci-host/q35.h" in the MCHPCIState, and
in "hw/pci/pci.h" by pci_bus_get_w64_range(). Let them include
"qemu/range.h" directly to simplify "qemu/typedefs.h".
To clean "qemu/typedefs.h", move the declaration to "qemu/range.h"
(removing the forward declaration).
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/pci-host/q35.h | 1 +
include/hw/pci/pci.h | 1 +
include/qemu/range.h | 4 ++--
include/qemu/typedefs.h | 1 -
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 8f4ddde393..236ff008c9 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -22,6 +22,7 @@
#ifndef HW_Q35_H
#define HW_Q35_H
+#include "qemu/range.h"
#include "hw/hw.h"
#include "hw/isa/isa.h"
#include "hw/sysbus.h"
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index d87f5f93e9..f9c020fd98 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -1,6 +1,7 @@
#ifndef QEMU_PCI_H
#define QEMU_PCI_H
+#include "qemu/range.h"
#include "hw/qdev.h"
#include "exec/memory.h"
#include "sysemu/dma.h"
diff --git a/include/qemu/range.h b/include/qemu/range.h
index 7e75f4e655..aaa09c8306 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -29,7 +29,7 @@
* - Ranges must not wrap around 0, but can include UINT64_MAX.
*/
-struct Range {
+typedef struct Range {
/*
* Do not access members directly, use the functions!
* A non-empty range has @lob <= @upb.
@@ -37,7 +37,7 @@ struct Range {
*/
uint64_t lob; /* inclusive lower bound */
uint64_t upb; /* inclusive upper bound */
-};
+} Range;
static inline void range_invariant(const Range *range)
{
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 5e9a070ff3..fb9f29d892 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -97,7 +97,6 @@ typedef struct QNum QNum;
typedef struct QObject QObject;
typedef struct QString QString;
typedef struct RAMBlock RAMBlock;
-typedef struct Range Range;
typedef struct SHPCDevice SHPCDevice;
typedef struct uWireSlave uWireSlave;
typedef struct VirtIODevice VirtIODevice;
--
2.17.2
next prev parent reply other threads:[~2019-01-11 14:18 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 14:08 [Qemu-devel] [PATCH RESEND 00/15] typedefs: Remove scarcely used declarations Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 01/15] hw/input/ps2: Remove PS2State from "qemu/typedefs.h" Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 02/15] hw/pcmcia: Remove PCMCIACardState " Philippe Mathieu-Daudé
2019-01-14 8:39 ` Thomas Huth
2019-01-11 14:08 ` [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus " Philippe Mathieu-Daudé
2019-01-14 8:44 ` Thomas Huth
2019-01-15 12:28 ` Markus Armbruster
2019-01-15 12:56 ` Thomas Huth
2019-01-15 18:02 ` Paolo Bonzini
2019-01-16 8:33 ` Markus Armbruster
2019-01-16 10:03 ` Paolo Bonzini
2019-01-16 11:34 ` Gerd Hoffmann
2019-01-16 11:49 ` Paolo Bonzini
2019-01-16 14:48 ` Michael S. Tsirkin
2019-01-17 9:01 ` Markus Armbruster
2019-01-17 9:03 ` Markus Armbruster
2019-01-15 17:57 ` Paolo Bonzini
2019-01-16 8:32 ` Markus Armbruster
2019-01-11 14:08 ` [Qemu-devel] [PATCH 04/15] hw/ide/ahci: Remove AllwinnerAHCIState " Philippe Mathieu-Daudé
2019-01-14 8:45 ` Thomas Huth
2019-01-11 14:08 ` [Qemu-devel] [PATCH 05/15] hw/nvram/fw_cfg: Remove various typedefs " Philippe Mathieu-Daudé
2019-01-11 16:26 ` Laszlo Ersek
2019-01-14 10:26 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 06/15] hw/i2c/smbus: Remove SMBusDevice " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 07/15] hw/bt: Remove HCIInfo " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 08/15] hw/char/serial: Remove SerialState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 09/15] hw/i386: Remove PCMachineClass " Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé [this message]
2019-01-14 8:56 ` [Qemu-devel] [PATCH 10/15] range: Remove Range " Thomas Huth
2019-01-14 10:30 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 11/15] audio: Remove AudioState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 12/15] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Philippe Mathieu-Daudé
2019-01-14 8:59 ` Thomas Huth
2019-01-14 12:59 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 13/15] ui/console: Remove QemuDmaBuf from "qemu/typedefs.h" Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 14/15] ui/console: Remove DisplayState/DisplaySurface " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [RFC PATCH 15/15] ui/console: Add "ui/pixelformat.h" to declare PixelFormat Philippe Mathieu-Daudé
2019-01-11 17:32 ` Paolo Bonzini
2019-01-14 10:24 ` Philippe Mathieu-Daudé
2019-01-14 12:35 ` Gerd Hoffmann
2019-01-14 12:41 ` Philippe Mathieu-Daudé
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=20190111140857.4211-11-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=xiaoguangrong.eric@gmail.com \
/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).