All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v3 3/4] qdev: Simplify the SysBusDeviceClass::init path
Date: Mon, 7 May 2018 18:30:11 -0300	[thread overview]
Message-ID: <20180507213011.GL13350@localhost.localdomain> (raw)
In-Reply-To: <87bmee2vg0.fsf@dusky.pond.sub.org>

On Fri, Apr 20, 2018 at 09:22:55AM +0200, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
> 
> > On 04/19/2018 06:27 PM, Philippe Mathieu-Daudé wrote:
> >> The SysBusDevice is the last DeviceClass::init user.
> >> 
> >> Instead of using
> >>   SysBusDeviceClass::realize
> >>    -> DeviceClass::realize
> >>        -> DeviceClass::init
> >>            -> sysbus_device_init
> >>               -> SysBusDeviceClass::init
> >> 
> >> Simplify the path by directly calling SysBusDeviceClass::init
> >> in SysBusDeviceClass::realize:
> >> 
> >>   SysBusDeviceClass::realize
> >>    -> SysBusDeviceClass::init
> >> 
> >> Finally, remove the DeviceClass::init, there are no more users.
> >> 
> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >> ---
> >>  include/hw/qdev-core.h |  2 --
> >>  hw/core/qdev.c         | 14 --------------
> >>  hw/core/sysbus.c       | 15 ++++++++++-----
> >>  3 files changed, 10 insertions(+), 21 deletions(-)
> >> 
> >> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> >> index 9453588160..6f60748043 100644
> >> --- a/include/hw/qdev-core.h
> >> +++ b/include/hw/qdev-core.h
> >> @@ -29,7 +29,6 @@ typedef enum DeviceCategory {
> >>      DEVICE_CATEGORY_MAX
> >>  } DeviceCategory;
> >>  
> >> -typedef int (*qdev_initfn)(DeviceState *dev);
> >>  typedef int (*qdev_event)(DeviceState *dev);
> >>  typedef void (*DeviceRealize)(DeviceState *dev, Error **errp);
> >>  typedef void (*DeviceUnrealize)(DeviceState *dev, Error **errp);
> >> @@ -124,7 +123,6 @@ typedef struct DeviceClass {
> >>      const struct VMStateDescription *vmsd;
> >>  
> >>      /* Private to qdev / bus.  */
> >> -    qdev_initfn init; /* TODO remove, once users are converted to realize */
> >
> > The DeviceClass documentation (top of this file) is now out of date :(
> >
> > If the maintainer taking this series prefer a respin, I plan to only
> > remove the 'init' references in the big comment.
> 
> I'd move the actual removal into the next and final patch.  Lets us fix
> up the comment in one go.

I'd prefer a respin, so we can ensure the documentation is
updated and the removal of DeviceClass::init and
DeviceClass::exit are done in the same patch.

(Sorry for taking so long to reply.)

-- 
Eduardo

  reply	other threads:[~2018-05-07 21:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 21:27 [Qemu-devel] [PATCH v3 0/4] qdev: remove DeviceClass::init/exit() Philippe Mathieu-Daudé
2018-04-19 21:27 ` [Qemu-devel] [PATCH v3 1/4] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init Philippe Mathieu-Daudé
2018-04-20  7:24   ` Markus Armbruster
2018-04-19 21:27 ` [Qemu-devel] [PATCH v3 2/4] hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init Philippe Mathieu-Daudé
2018-04-20  7:24   ` Markus Armbruster
2018-04-19 21:27 ` [Qemu-devel] [PATCH v3 3/4] qdev: Simplify the SysBusDeviceClass::init path Philippe Mathieu-Daudé
2018-04-19 21:38   ` Philippe Mathieu-Daudé
2018-04-20  7:22     ` Markus Armbruster
2018-05-07 21:30       ` Eduardo Habkost [this message]
2018-04-25  6:45   ` Yoni Bettan
2018-04-19 21:27 ` [Qemu-devel] [PATCH v3 4/4] qdev: Remove DeviceClass::exit Philippe Mathieu-Daudé
2018-04-20  7:25   ` Markus Armbruster
2018-04-19 21:31 ` [Qemu-devel] [PATCH v3 0/4] qdev: remove DeviceClass::init/exit() 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=20180507213011.GL13350@localhost.localdomain \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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.