[patch] stop passing in global variable as argument to cmos_init()

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

 



Hi,

Looking through the ia64 code I came across this little gem.

At some point someone added a new argument to hw/pc.c:cmos_init() named
'smp_cpus', and then passed in the global variable 'smp_cpus' as the
argument. This propagated through to the ia64 code as well.

I checked, this isn't present in the upstream QEMU code, so lets kill
it in the KVM branch. One small step to get closer to upstream :-)

Cheers,
Jes

There is no reason to pass in global variable smp_cpus to cmos_init()
which then references it as a local variable of the same name 'smp_cpus'.

Signed-off-by: Jes Sorensen <jes@xxxxxxx>

---
 qemu/hw/ipf.c |    5 ++---
 qemu/hw/pc.c  |    6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

Index: kvm-userspace.git/qemu/hw/ipf.c
===================================================================
--- kvm-userspace.git.orig/qemu/hw/ipf.c
+++ kvm-userspace.git/qemu/hw/ipf.c
@@ -179,8 +179,7 @@
 
 /* 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,
-                      int smp_cpus)
+                      const char *boot_device, BlockDriverState **hd_table)
 {
     RTCState *s = rtc_state;
     int nbds, bds[3] = { 0, };
@@ -591,7 +590,7 @@
     }
     floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd);
 
-    cmos_init(ram_size, above_4g_mem_size, boot_device, hd, smp_cpus);
+    cmos_init(ram_size, above_4g_mem_size, boot_device, hd);
 
     if (pci_enabled && usb_enabled) {
         usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
Index: kvm-userspace.git/qemu/hw/pc.c
===================================================================
--- kvm-userspace.git.orig/qemu/hw/pc.c
+++ kvm-userspace.git/qemu/hw/pc.c
@@ -228,8 +228,7 @@
 
 /* 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,
-                      int smp_cpus)
+                      const char *boot_device, BlockDriverState **hd_table)
 {
     RTCState *s = rtc_state;
     int nbds, bds[3] = { 0, };
@@ -1093,8 +1092,7 @@
     }
     floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd);
 
-    cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd,
-	      smp_cpus);
+    cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, hd);
 
     if (pci_enabled && usb_enabled) {
         usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);

[Index of Archives]     [Linux KVM Devel]     [Linux Virtualization]     [Big List of Linux Books]     [Linux SCSI]     [Yosemite Forum]

  Powered by Linux