qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Miroslav Rezanina <mrezanin@redhat.com>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Make usb-bt-dongle configurable
Date: Mon, 19 Aug 2013 14:31:16 +0200	[thread overview]
Message-ID: <52121014.8050108@suse.de> (raw)
In-Reply-To: <52081254.597343.1376909324949.JavaMail.root@redhat.com>

Am 19.08.2013 12:48, schrieb Miroslav Rezanina:
> usb-bt-dongle device can't be disabled as there's dependency in vl.c file. This patch add preprocesor condition to be able to disable it.

Please limit to 76 chars per line (check `git log` output).

> 
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> ---
>  hw/usb/Makefile.objs |  1 -
>  vl.c                 | 18 ++++++++++++++----
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
> index f9695e7..8892ffd 100644
> --- a/hw/usb/Makefile.objs
> +++ b/hw/usb/Makefile.objs
> @@ -20,7 +20,6 @@ common-obj-$(CONFIG_USB_SERIAL)       += dev-serial.o
>  common-obj-$(CONFIG_USB_NETWORK)      += dev-network.o
>  
>  # FIXME: make configurable too
> -CONFIG_USB_BLUETOOTH := y

You probably should delete the FIXME alongside?

>  common-obj-$(CONFIG_USB_BLUETOOTH)    += dev-bluetooth.o
>  
>  ifeq ($(CONFIG_USB_SMARTCARD),y)
> diff --git a/vl.c b/vl.c
> index f422a1c..4330b6d 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1526,8 +1526,10 @@ static void configure_msg(QemuOpts *opts)
>  
>  static int usb_device_add(const char *devname)
>  {
> -    const char *p;
>      USBDevice *dev = NULL;
> +#if  defined(CONFIG_USB_BLUETOOTH) || !defined(CONFIG_LINUX)

Double space.

> +    const char *p;
> +#endif
>  
>      if (!usb_enabled(false)) {
>          return -1;
> @@ -1543,15 +1545,23 @@ static int usb_device_add(const char *devname)
>      /* only the linux version is qdev-ified, usb-bsd still needs this */
>      if (strstart(devname, "host:", &p)) {
>          dev = usb_host_device_open(usb_bus_find(-1), p);
> -    } else
> +        goto devtest;
> +    } 
>  #endif
> +#ifdef CONFIG_USB_BLUETOOTH
>      if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
>          dev = usb_bt_init(usb_bus_find(-1),
>                            devname[2] ? hci_init(p)
>                                       : bt_new_hci(qemu_find_bt_vlan(0)));
> -    } else {
> -        return -1;
> +        goto devtest;
>      }
> +#endif
> +
> +    return -1;
> +
> +#if  defined(CONFIG_USB_BLUETOOTH) || !defined(CONFIG_LINUX)
> +devtest:
> +#endif

Why put only the label in an #if block? The below is dead code if not
reached via devtest.

>      if (!dev)
>          return -1;
>  

Let's also not forget to CC Gerd as USB maintainer.

Regards,
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:[~2013-08-19 12:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 10:48 [Qemu-devel] [PATCH] Make usb-bt-dongle configurable Miroslav Rezanina
2013-08-19 12:31 ` Andreas Färber [this message]
2013-08-19 13:30   ` Laszlo Ersek
2013-08-19 13:41     ` Andreas Färber
2013-08-19 13:58       ` Paolo Bonzini
2013-08-19 14:19         ` Gerd Hoffmann
2013-08-19 12:55 ` Paolo Bonzini

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=52121014.8050108@suse.de \
    --to=afaerber@suse.de \
    --cc=kraxel@redhat.com \
    --cc=mrezanin@redhat.com \
    --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).