qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH qom-next v1 2/6] ssi: Remove legacy SSI_BUS->BUS cast
Date: Tue, 04 Mar 2014 21:43:03 +0100	[thread overview]
Message-ID: <53163AD7.9060502@suse.de> (raw)
In-Reply-To: <f6a7df858c39f336b240d6cd26d3c8fc75a1cd91.1392164348.git.peter.crosthwaite@xilinx.com>

Am 12.02.2014 01:28, schrieb Peter Crosthwaite:
> Remove two legacy ->qbus style casts from TYPE_SSI_BUS to TYPE_BUS in
> ssi.c.
> 
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
> 
>  hw/ssi/ssi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
> index 2c25260..f2bdf30 100644
> --- a/hw/ssi/ssi.c
> +++ b/hw/ssi/ssi.c
> @@ -88,7 +88,7 @@ static const TypeInfo ssi_slave_info = {
>  
>  DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name)
>  {
> -    return qdev_create(&bus->qbus, name);
> +    return qdev_create(BUS(bus), name);
>  }
>  
>  DeviceState *ssi_create_slave(SSIBus *bus, const char *name)
> @@ -156,7 +156,7 @@ static int ssi_auto_connect_slave(Object *child, void *opaque)
>      }
>  
>      cs_line = qdev_get_gpio_in(DEVICE(dev), 0);
> -    qdev_set_parent_bus(DEVICE(dev), &arg->bus->qbus);
> +    qdev_set_parent_bus(DEVICE(dev), BUS(arg->bus));
>      **arg->cs_linep = cs_line;
>      (*arg->cs_linep)++;
>      return 0;

Let's be consequent and add this:

diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index f2bdf30..7be7c53 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -15,7 +15,7 @@
 #include "hw/ssi.h"

 struct SSIBus {
-    BusState qbus;
+    BusState parent_obj;
 };

 #define TYPE_SSI_BUS "SSI"
@@ -108,11 +108,12 @@ SSIBus *ssi_create_bus(DeviceState *parent, const
char *name)

 uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
 {
+    BusState *b = BUS(bus);
     BusChild *kid;
     SSISlaveClass *ssc;
     uint32_t r = 0;

-    QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) {
+    QTAILQ_FOREACH(kid, &b->children, sibling) {
         SSISlave *slave = SSI_SLAVE(kid->child);
         ssc = SSI_SLAVE_GET_CLASS(slave);
         r |= ssc->transfer_raw(slave, val);

Cheers,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2014-03-04 20:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12  0:27 [Qemu-devel] [PATCH qom-next v1 0/6] SSI QOM cleanups Peter Crosthwaite
2014-02-12  0:27 ` [Qemu-devel] [PATCH qom-next v1 1/6] ssi: Convert legacy casts from SSI_SLAVE->DEVICE Peter Crosthwaite
2014-03-04 22:07   ` Andreas Färber
2014-03-04 22:23     ` Andreas Färber
2014-02-12  0:28 ` [Qemu-devel] [PATCH qom-next v1 2/6] ssi: Remove legacy SSI_BUS->BUS cast Peter Crosthwaite
2014-03-04 20:43   ` Andreas Färber [this message]
2014-02-12  0:29 ` [Qemu-devel] [PATCH qom-next v1 3/6] misc: max111x: Create abstract max111x class Peter Crosthwaite
2014-02-12  0:29 ` [Qemu-devel] [PATCH qom-next v1 4/6] misc: max111x: QOM casting sweep Peter Crosthwaite
2014-03-04 20:51   ` Andreas Färber
2014-02-12  0:30 ` [Qemu-devel] [PATCH qom-next v1 5/6] ssi: Remove SSI_SLAVE_FROM_QDEV macro Peter Crosthwaite
2014-02-12  0:30 ` [Qemu-devel] [PATCH qom-next v1 6/6] block/m25p80: Remove FROM_SSI_SLAVE usages Peter Crosthwaite
2014-03-04 20:57   ` Andreas Färber
2014-02-25  8:46 ` [Qemu-devel] [PATCH qom-next v1 0/6] SSI QOM cleanups Peter Crosthwaite
2014-02-25  8:51   ` Andreas Färber
2014-03-04 22:39     ` Andreas Färber
2014-03-04 23:32       ` Peter Crosthwaite

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=53163AD7.9060502@suse.de \
    --to=afaerber@suse.de \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).