All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"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>,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	qemu-arm@nongnu.org,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Ben Warren <ben@skyportsystems.com>
Subject: Re: [Qemu-devel] [PATCH 05/15] hw/nvram/fw_cfg: Remove various typedefs from "qemu/typedefs.h"
Date: Fri, 11 Jan 2019 17:26:06 +0100	[thread overview]
Message-ID: <32678400-47af-a842-0563-0d1a72712b4a@redhat.com> (raw)
In-Reply-To: <20190111140857.4211-6-philmd@redhat.com>

On 01/11/19 15:08, Philippe Mathieu-Daudé wrote:
> There are only three files requiring these typedefs, let them
> include "hw/nvram/fw_cfg.h" directly to simplify "qemu/typedefs.h".
> 
> To clean "qemu/typedefs.h", move the forward declarations
> to "hw/nvram/fw_cfg.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/hw/acpi/vmgenid.h | 1 +
>  include/hw/arm/virt.h     | 1 +
>  include/hw/mem/nvdimm.h   | 1 +
>  include/hw/nvram/fw_cfg.h | 8 +++++++-
>  include/qemu/typedefs.h   | 4 ----
>  5 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h
> index 38586ecbdf..be53de38f1 100644
> --- a/include/hw/acpi/vmgenid.h
> +++ b/include/hw/acpi/vmgenid.h
> @@ -3,6 +3,7 @@
>  
>  #include "hw/acpi/bios-linker-loader.h"
>  #include "hw/qdev.h"
> +#include "hw/nvram/fw_cfg.h"
>  #include "qemu/uuid.h"
>  
>  #define VMGENID_DEVICE           "vmgenid"
> diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
> index 4cc57a7ef6..fef632dcf5 100644
> --- a/include/hw/arm/virt.h
> +++ b/include/hw/arm/virt.h
> @@ -35,6 +35,7 @@
>  #include "qemu/notify.h"
>  #include "hw/boards.h"
>  #include "hw/arm/arm.h"
> +#include "hw/nvram/fw_cfg.h"
>  #include "sysemu/kvm.h"
>  #include "hw/intc/arm_gicv3_common.h"
>  
> diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h
> index c5c9b3c7f8..51d3a52c4b 100644
> --- a/include/hw/mem/nvdimm.h
> +++ b/include/hw/mem/nvdimm.h
> @@ -24,6 +24,7 @@
>  #define QEMU_NVDIMM_H
>  
>  #include "hw/mem/pc-dimm.h"
> +#include "hw/nvram/fw_cfg.h"
>  #include "hw/acpi/bios-linker-loader.h"
>  
>  #define NVDIMM_DEBUG 0
> diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> index f5a6895a74..244ed78afa 100644
> --- a/include/hw/nvram/fw_cfg.h
> +++ b/include/hw/nvram/fw_cfg.h
> @@ -14,7 +14,9 @@
>  #define FW_CFG_IO(obj)  OBJECT_CHECK(FWCfgIoState,  (obj), TYPE_FW_CFG_IO)
>  #define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM)
>  
> -typedef struct fw_cfg_file FWCfgFile;
> +typedef struct FWCfgState FWCfgState;
> +typedef struct FWCfgIoState FWCfgIoState;
> +typedef struct FWCfgMemState FWCfgMemState;

I think the resultant file would be easier to read if you moved the
State typedefs before the spot where we make the first references to
them, namely in the FW_CFG*() function-like macros.

With that,

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo

>  
>  #define FW_CFG_ORDER_OVERRIDE_VGA    70
>  #define FW_CFG_ORDER_OVERRIDE_NIC    80
> @@ -24,6 +26,8 @@ typedef struct fw_cfg_file FWCfgFile;
>  void fw_cfg_set_order_override(FWCfgState *fw_cfg, int order);
>  void fw_cfg_reset_order_override(FWCfgState *fw_cfg);
>  
> +typedef struct fw_cfg_file FWCfgFile;
> +
>  typedef struct FWCfgFiles {
>      uint32_t  count;
>      FWCfgFile f[];
> @@ -34,6 +38,8 @@ typedef struct fw_cfg_dma_access FWCfgDmaAccess;
>  typedef void (*FWCfgCallback)(void *opaque);
>  typedef void (*FWCfgWriteCallback)(void *opaque, off_t start, size_t len);
>  
> +typedef struct FWCfgEntry FWCfgEntry;
> +
>  struct FWCfgState {
>      /*< private >*/
>      SysBusDevice parent_obj;
> diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> index 3a5ca74bd3..1c294c296c 100644
> --- a/include/qemu/typedefs.h
> +++ b/include/qemu/typedefs.h
> @@ -31,10 +31,6 @@ typedef struct DriveInfo DriveInfo;
>  typedef struct Error Error;
>  typedef struct EventNotifier EventNotifier;
>  typedef struct FlatView FlatView;
> -typedef struct FWCfgEntry FWCfgEntry;
> -typedef struct FWCfgIoState FWCfgIoState;
> -typedef struct FWCfgMemState FWCfgMemState;
> -typedef struct FWCfgState FWCfgState;
>  typedef struct HCIInfo HCIInfo;
>  typedef struct HVFX86EmulatorState HVFX86EmulatorState;
>  typedef struct I2CBus I2CBus;
> 

  reply	other threads:[~2019-01-11 16:26 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 [this message]
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 ` [Qemu-devel] [PATCH 10/15] range: Remove Range " Philippe Mathieu-Daudé
2019-01-14  8:56   ` 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=32678400-47af-a842-0563-0d1a72712b4a@redhat.com \
    --to=lersek@redhat.com \
    --cc=ben@skyportsystems.com \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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 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.