WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [rfc 12/18] ioemu: piix4acpi.c: remove unnecessary assignmen

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [rfc 12/18] ioemu: piix4acpi.c: remove unnecessary assignment of pci_slots to local variables
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Tue, 17 Feb 2009 20:08:00 +1100
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Tue, 17 Feb 2009 01:31:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090217090748.580007796@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: ioemu-remote/hw/piix4acpi.c
===================================================================
--- ioemu-remote/hw/piix4acpi.c 2009-01-02 16:13:05.000000000 +1100
+++ ioemu-remote/hw/piix4acpi.c 2009-01-02 16:15:29.000000000 +1100
@@ -302,21 +302,23 @@ static int pcislots_load(QEMUFile* f, vo
 
 static void php_slots_init(void)
 {
-    PHPSlots *slots = &php_slots;
     int i;
-    memset(slots, 0, sizeof(PHPSlots));
+    memset(&php_slots, 0, sizeof(PHPSlots));
 
     /* update the pci slot status */
     for ( i = 0; i < PHP_SLOT_LEN; i++ ) {
         if ( test_pci_slot( PHP_TO_PCI_SLOT(i) ) == 1 )
-            slots->status[i] = 0xf;
+            php_slots.status[i] = 0xf;
     }
 
 
     /* ACPI PCI hotplug controller */
-    register_ioport_read(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1, 
acpi_php_readb, slots);
-    register_ioport_write(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1, 
acpi_php_writeb, slots);
-    register_savevm("pcislots", 0, 1, pcislots_save, pcislots_load, slots);
+    register_ioport_read(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1,
+                         acpi_php_readb, &php_slots);
+    register_ioport_write(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1,
+                          acpi_php_writeb, &php_slots);
+    register_savevm("pcislots", 0, 1, pcislots_save, pcislots_load,
+                    &php_slots);
 }
 
 /* GPEx_STS occupy 1st half of the block, while GPEx_EN 2nd half */
@@ -452,7 +454,6 @@ static void acpi_sci_intr(GPEState *s)
 void acpi_php_del(int pci_slot)
 {
     GPEState *s = &gpe_state;
-    PHPSlots *hotplug_slots = &php_slots;
     int php_slot = PCI_TO_PHP_SLOT(pci_slot);
 
     if ( pci_slot < PHP_SLOT_START || pci_slot >= PHP_SLOT_END ) {
@@ -462,7 +463,7 @@ void acpi_php_del(int pci_slot)
     }
 
     /* update the php controller status */
-    hotplug_slots->plug_evt = (((php_slot+1) << 4) | PHP_EVT_REMOVE);
+    php_slots.plug_evt = (((php_slot+1) << 4) | PHP_EVT_REMOVE);
 
     /* generate a SCI interrupt */
     acpi_sci_intr(s);
@@ -471,7 +472,6 @@ void acpi_php_del(int pci_slot)
 void acpi_php_add(int pci_slot)
 {
     GPEState *s = &gpe_state;
-    PHPSlots *hotplug_slots = &php_slots;
     int php_slot = PCI_TO_PHP_SLOT(pci_slot);
     char ret_str[30];
 
@@ -490,10 +490,10 @@ void acpi_php_add(int pci_slot)
     }
 
     /* update the php controller status */
-    hotplug_slots->plug_evt = (((php_slot+1) << 4) | PHP_EVT_ADD);
+    php_slots.plug_evt = (((php_slot+1) << 4) | PHP_EVT_ADD);
 
     /* update the slot status as present */
-    hotplug_slots->status[php_slot]= 0xf;
+    php_slots.status[php_slot]= 0xf;
 
     /* power on the slot */
     power_on_php_slot(php_slot);

-- 

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>