From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBOcL-00013J-6S for qemu-devel@nongnu.org; Mon, 19 Aug 2013 08:31:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBOcD-0002mv-QP for qemu-devel@nongnu.org; Mon, 19 Aug 2013 08:31:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59546 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBOcD-0002mh-GU for qemu-devel@nongnu.org; Mon, 19 Aug 2013 08:31:21 -0400 Message-ID: <52121014.8050108@suse.de> Date: Mon, 19 Aug 2013 14:31:16 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <52081254.597343.1376909324949.JavaMail.root@redhat.com> In-Reply-To: <52081254.597343.1376909324949.JavaMail.root@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Make usb-bt-dongle configurable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miroslav Rezanina Cc: qemu-devel@nongnu.org, Gerd Hoffmann Am 19.08.2013 12:48, schrieb Miroslav Rezanina: > usb-bt-dongle device can't be disabled as there's dependency in vl.c fi= le. This patch add preprocesor condition to be able to disable it. Please limit to 76 chars per line (check `git log` output). >=20 > Signed-off-by: Miroslav Rezanina > --- > hw/usb/Makefile.objs | 1 - > vl.c | 18 ++++++++++++++---- > 2 files changed, 14 insertions(+), 5 deletions(-) >=20 > 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) +=3D dev-serial= .o > common-obj-$(CONFIG_USB_NETWORK) +=3D dev-network.o > =20 > # FIXME: make configurable too > -CONFIG_USB_BLUETOOTH :=3D y You probably should delete the FIXME alongside? > common-obj-$(CONFIG_USB_BLUETOOTH) +=3D dev-bluetooth.o > =20 > 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) > =20 > static int usb_device_add(const char *devname) > { > - const char *p; > USBDevice *dev =3D NULL; > +#if defined(CONFIG_USB_BLUETOOTH) || !defined(CONFIG_LINUX) Double space. > + const char *p; > +#endif > =20 > 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 =3D usb_host_device_open(usb_bus_find(-1), p); > - } else > + goto devtest; > + }=20 > #endif > +#ifdef CONFIG_USB_BLUETOOTH > if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) { > dev =3D 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; > =20 Let's also not forget to CC Gerd as USB maintainer. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg