qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/17] pc.c: remove a global variable, floppy_contro


From: Isaku Yamahata
Subject: [Qemu-devel] [PATCH 08/17] pc.c: remove a global variable, floppy_controller.
Date: Wed, 15 Jul 2009 16:19:08 +0900

Remove a global variable, floppy_controller.
Since it is unnecessarily global, make it local and pass it as
a function argument.

Signed-off-by: Isaku Yamahata <address@hidden>
---
 hw/pc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 4ab8203..de1f06b 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -57,7 +57,6 @@
 
 #define MAX_IDE_BUS 2
 
-static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 
 typedef struct rom_reset_data {
@@ -267,7 +266,8 @@ static int pc_boot_set(void *opaque, const char 
*boot_device)
 
 /* hd_table must contain 4 block drivers */
 static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
-                      const char *boot_device, BlockDriverState **hd_table)
+                      const char *boot_device, BlockDriverState **hd_table,
+                      fdctrl_t *floppy_controller)
 {
     RTCState *s = rtc_state;
     int nbds, bds[3] = { 0, };
@@ -1123,6 +1123,7 @@ static void pc_init1(ram_addr_t ram_size,
     int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled;
     void *fw_cfg;
     const char *virtio_blk_name, *virtio_console_name;
+    fdctrl_t *floppy_controller;
     PITState *pit;
     IOAPICState *ioapic = NULL;
 
@@ -1374,7 +1375,8 @@ static void pc_init1(ram_addr_t ram_size,
     }
     floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd);
 
-    cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd);
+    cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd,
+              floppy_controller);
 
     if (pci_enabled && usb_enabled) {
         usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
-- 
1.6.0.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]