]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vl: Eliminate usb_enabled()
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 8 Jun 2016 20:50:25 +0000 (17:50 -0300)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 13 Jun 2016 11:24:41 +0000 (13:24 +0200)
This wrapper for machine_usb(current_machine) is not necessary,
replace all usages of usb_enabled() with machine_usb().

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-arm@nongnu.org
Cc: qemu-ppc@nongnu.org
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1465419025-21519-3-git-send-email-ehabkost@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/arm/nseries.c
hw/arm/realview.c
hw/arm/versatilepb.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
hw/ppc/mac_oldworld.c
hw/ppc/prep.c
include/sysemu/sysemu.h
vl.c

index d4eb14176464b2c0eef8364b9a70edc6d277ce50..fea911e3e38b85ed26b83d7cf4cbcdc63b6d4737 100644 (file)
@@ -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);
     }
 
index 7d0aa6ff4f6a719b25c587a45bd8cf1810864549..8eafccaf1de81a13f5217af8cf3bbac0052a46a3 100644 (file)
@@ -254,7 +254,7 @@ static void realview_init(MachineState *machine,
         sysbus_connect_irq(busdev, 2, pic[50]);
         sysbus_connect_irq(busdev, 3, pic[51]);
         pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci");
-        if (usb_enabled()) {
+        if (machine_usb(machine)) {
             pci_create_simple(pci_bus, -1, "pci-ohci");
         }
         n = drive_get_max_bus(IF_SCSI);
index 20dd3561c88b34a066ecbb9fd56757493a6b6066..8ae5392bcc162fff49bb2c905d0576addb648d60 100644 (file)
@@ -276,7 +276,7 @@ static void versatile_init(MachineState *machine, int board_id)
             pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
         }
     }
-    if (usb_enabled()) {
+    if (machine_usb(machine)) {
         pci_create_simple(pci_bus, -1, "pci-ohci");
     }
     n = drive_get_max_bus(IF_SCSI);
index 14dd0cc7742dc445290adc8c583cf91db6dee679..82c7c0a5fa427190686ba3bf1eed3f2a6d0a16bf 100644 (file)
@@ -262,7 +262,7 @@ static void pc_init1(MachineState *machine,
 
     pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
 
-    if (pcmc->pci_enabled && usb_enabled()) {
+    if (pcmc->pci_enabled && machine_usb(machine)) {
         pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
     }
 
index 04aae8958c5de7997a21c33e46a53ff629353df4..31a6a5938393af65c7c048707deeacffd47525a9 100644 (file)
@@ -234,7 +234,7 @@ static void pc_q35_init(MachineState *machine)
     ide_drive_get(hd, ICH_AHCI(ahci)->ahci.ports);
     ahci_ide_create_devs(ahci, hd);
 
-    if (usb_enabled()) {
+    if (machine_usb(machine)) {
         /* Should we create 6 UHCI according to ich9 spec? */
         ehci_create_ich9_with_companions(host_bus, 0x1d);
     }
index a9bb1c27df1fc31b967ea81daa055628c4f5b458..447948746b1a0b515bcfc3add1378759cabb8bd7 100644 (file)
@@ -309,7 +309,7 @@ static void ppc_heathrow_init(MachineState *machine)
     dev = qdev_create(adb_bus, TYPE_ADB_MOUSE);
     qdev_init_nofail(dev);
 
-    if (usb_enabled()) {
+    if (machine_usb(machine)) {
         pci_create_simple(pci_bus, -1, "pci-ohci");
     }
 
index 07ffe72de1d062b550503222fb3c06cb189419b1..054af1e8b48184d76541e9c00a6388c668de761b 100644 (file)
@@ -649,7 +649,7 @@ static void ppc_prep_init(MachineState *machine)
     memory_region_add_subregion(sysmem, 0xFEFF0000, xcsr);
 #endif
 
-    if (usb_enabled()) {
+    if (machine_usb(machine)) {
         pci_create_simple(pci_bus, -1, "pci-ohci");
     }
 
index 94281413d08db6fd2b4223edad06d1f1b2f2d1ff..7313673b668842465f7237079f5ca5dc40ea76f7 100644 (file)
@@ -233,7 +233,6 @@ void qemu_boot_set(const char *boot_order, Error **errp);
 QemuOpts *qemu_get_machine_opts(void);
 
 bool defaults_enabled(void);
-bool usb_enabled(void);
 
 extern QemuOptsList qemu_legacy_drive_opts;
 extern QemuOptsList qemu_common_drive_opts;
diff --git a/vl.c b/vl.c
index b0bcc255ee9a56e6002c3e76054b0a077091d579..45eff5661b207af1ae8d165540cb0b06fafe8e79 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1072,11 +1072,6 @@ bool defaults_enabled(void)
     return has_defaults;
 }
 
-bool usb_enabled(void)
-{
-    return machine_usb(current_machine);
-}
-
 #ifndef _WIN32
 static int parse_add_fd(void *opaque, QemuOpts *opts, Error **errp)
 {
@@ -1393,7 +1388,7 @@ static int usb_device_add(const char *devname)
     const char *p;
 #endif
 
-    if (!usb_enabled()) {
+    if (!machine_usb(current_machine)) {
         return -1;
     }
 
@@ -1425,7 +1420,7 @@ static int usb_device_del(const char *devname)
         return -1;
     }
 
-    if (!usb_enabled()) {
+    if (!machine_usb(current_machine)) {
         return -1;
     }
 
@@ -4501,7 +4496,7 @@ int main(int argc, char **argv, char **envp)
     }
 
     /* init USB devices */
-    if (usb_enabled()) {
+    if (machine_usb(current_machine)) {
         if (foreach_device_config(DEV_USB, usb_parse) < 0)
             exit(1);
     }