qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, Andrzej Zaborowski <balrogg@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] vl: Eliminate usb_enabled()
Date: Wed, 8 Jun 2016 07:48:12 -0400 (EDT)	[thread overview]
Message-ID: <2031741745.20794862.1465386492642.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <575800B5.10608@redhat.com>



----- Original Message -----
> From: "Marcel Apfelbaum" <marcel@redhat.com>
> To: "Eduardo Habkost" <ehabkost@redhat.com>, qemu-devel@nongnu.org
> Cc: "Paolo Bonzini" <pbonzini@redhat.com>, "Andrzej Zaborowski" <balrogg@gmail.com>, "Peter Maydell"
> <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, "Alexander Graf" <agraf@suse.de>
> Sent: Wednesday, June 8, 2016 1:25:41 PM
> Subject: Re: [PATCH] vl: Eliminate usb_enabled()
> 
> On 06/07/2016 07:56 PM, Eduardo Habkost wrote:
> > This wrapper for machine_usb(current_machine) is not necessary,
> > replace all usages of usb_enabled() with machine_usb().
> >
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> >   hw/arm/nseries.c        |  2 +-
> >   hw/arm/pxa2xx.c         |  7 +++++--
> >   hw/arm/realview.c       |  2 +-
> >   hw/arm/versatilepb.c    |  2 +-
> >   hw/i386/pc_piix.c       |  2 +-
> >   hw/i386/pc_q35.c        |  2 +-
> >   hw/ppc/mac_oldworld.c   |  2 +-
> >   hw/ppc/prep.c           |  2 +-
> >   include/sysemu/sysemu.h |  1 -
> >   vl.c                    | 11 +++--------
> >   10 files changed, 15 insertions(+), 18 deletions(-)
> >
> > diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> > index d4eb141..fea911e 100644
> > --- a/hw/arm/nseries.c
> > +++ b/hw/arm/nseries.c
> > @@ -1351,7 +1351,7 @@ static void n8x0_init(MachineState *machine,
> >       n8x0_dss_setup(s);
> >       n8x0_cbus_setup(s);
> >       n8x0_uart_setup(s);
> > -    if (usb_enabled()) {
> > +    if (machine_usb(machine)) {
> >           n8x0_usb_setup(s);
> >       }
> >
> > diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
> > index e41a7c9..6d8606d 100644
> > --- a/hw/arm/pxa2xx.c
> > +++ b/hw/arm/pxa2xx.c
> > @@ -13,6 +13,7 @@
> >   #include "cpu.h"
> >   #include "hw/sysbus.h"
> >   #include "hw/arm/pxa.h"
> > +#include "hw/boards.h"
> >   #include "sysemu/sysemu.h"
> >   #include "hw/char/serial.h"
> >   #include "hw/i2c/i2c.h"
> 
> Hi Eduardo,
> 
> > @@ -2062,6 +2063,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
> >       int i;
> >       DriveInfo *dinfo;
> >       s = g_new0(PXA2xxState, 1);
> > +    MachineState *machine = MACHINE(qdev_get_machine());
> >
> 
> All the callers of pxa270_init have a reference to the machine,
> you can pass it as parameter IMO.

Another possibility is to pass a "bool usb_enabled" argument.

Paolo

  reply	other threads:[~2016-06-08 11:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 16:56 [Qemu-devel] [PATCH] vl: Eliminate usb_enabled() Eduardo Habkost
2016-06-08 11:25 ` Marcel Apfelbaum
2016-06-08 11:48   ` Paolo Bonzini [this message]
2016-06-08 13:34     ` Peter Maydell
2016-06-08 17:13       ` Eduardo Habkost

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=2031741745.20794862.1465386492642.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=balrogg@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.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).