From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbX8n-0004lI-Vx for qemu-devel@nongnu.org; Mon, 23 Feb 2009 04:30:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbX8m-0004kS-S8 for qemu-devel@nongnu.org; Mon, 23 Feb 2009 04:30:21 -0500 Received: from [199.232.76.173] (port=56509 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbX8m-0004kM-ON for qemu-devel@nongnu.org; Mon, 23 Feb 2009 04:30:20 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:59227) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LbX8l-0006xe-Vx for qemu-devel@nongnu.org; Mon, 23 Feb 2009 04:30:20 -0500 Received: from yukiko.kent.sydney.vergenet.net (124-170-75-170.dyn.iinet.net.au [124.170.75.170]) by kirsty.vergenet.net (Postfix) with ESMTP id C1F9D24076 for ; Mon, 23 Feb 2009 20:30:18 +1100 (EST) Message-Id: <20090223092901.405754927@vergenet.net> References: <20090223091810.891526738@vergenet.net> Date: Mon, 23 Feb 2009 20:18:11 +1100 From: Simon Horman Content-Disposition: inline; filename=qemu-lsi_scsi_init-no-devfn-arg.patch Subject: [Qemu-devel] [patch 1/5] ioemu: Remove lsi_scsi_init()s devfn parameter as it is always passed as -1 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Signed-off-by: Simon Horman Index: qemu/hw/lsi53c895a.c =================================================================== --- qemu.orig/hw/lsi53c895a.c 2009-02-23 18:33:24.000000000 +1100 +++ qemu/hw/lsi53c895a.c 2009-02-23 18:33:29.000000000 +1100 @@ -1974,13 +1974,13 @@ static int lsi_scsi_uninit(PCIDevice *d) return 0; } -void *lsi_scsi_init(PCIBus *bus, int devfn) +void *lsi_scsi_init(PCIBus *bus) { LSIState *s; uint8_t *pci_conf; s = (LSIState *)pci_register_device(bus, "LSI53C895A SCSI HBA", - sizeof(*s), devfn, NULL, NULL); + sizeof(*s), -1, NULL, NULL); if (s == NULL) { fprintf(stderr, "lsi-scsi: Failed to register PCI device\n"); return NULL; Index: qemu/hw/pc.c =================================================================== --- qemu.orig/hw/pc.c 2009-02-23 18:33:24.000000000 +1100 +++ qemu/hw/pc.c 2009-02-23 18:33:29.000000000 +1100 @@ -1078,7 +1078,7 @@ vga_bios_error: max_bus = drive_get_max_bus(IF_SCSI); for (bus = 0; bus <= max_bus; bus++) { - scsi = lsi_scsi_init(pci_bus, -1); + scsi = lsi_scsi_init(pci_bus); for (unit = 0; unit < LSI_MAX_DEVS; unit++) { index = drive_get_index(IF_SCSI, bus, unit); if (index == -1) Index: qemu/hw/pci.h =================================================================== --- qemu.orig/hw/pci.h 2009-02-23 18:33:24.000000000 +1100 +++ qemu/hw/pci.h 2009-02-23 18:33:29.000000000 +1100 @@ -263,7 +263,7 @@ pci_config_set_class(uint8_t *pci_config /* lsi53c895a.c */ #define LSI_MAX_DEVS 7 void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id); -void *lsi_scsi_init(PCIBus *bus, int devfn); +void *lsi_scsi_init(PCIBus *bus); /* vmware_vga.c */ void pci_vmsvga_init(PCIBus *bus, uint8_t *vga_ram_base, Index: qemu/hw/realview.c =================================================================== --- qemu.orig/hw/realview.c 2009-02-23 18:33:24.000000000 +1100 +++ qemu/hw/realview.c 2009-02-23 18:33:29.000000000 +1100 @@ -112,7 +112,7 @@ static void realview_init(ram_addr_t ram fprintf(stderr, "qemu: too many SCSI bus\n"); exit(1); } - scsi_hba = lsi_scsi_init(pci_bus, -1); + scsi_hba = lsi_scsi_init(pci_bus); for (n = 0; n < LSI_MAX_DEVS; n++) { index = drive_get_index(IF_SCSI, 0, n); if (index == -1) Index: qemu/hw/versatilepb.c =================================================================== --- qemu.orig/hw/versatilepb.c 2009-02-23 18:33:24.000000000 +1100 +++ qemu/hw/versatilepb.c 2009-02-23 18:33:29.000000000 +1100 @@ -207,7 +207,7 @@ static void versatile_init(ram_addr_t ra fprintf(stderr, "qemu: too many SCSI bus\n"); exit(1); } - scsi_hba = lsi_scsi_init(pci_bus, -1); + scsi_hba = lsi_scsi_init(pci_bus); for (n = 0; n < LSI_MAX_DEVS; n++) { index = drive_get_index(IF_SCSI, 0, n); if (index == -1) Index: qemu/hw/pci-hotplug.c =================================================================== --- qemu.orig/hw/pci-hotplug.c 2009-02-23 18:33:36.000000000 +1100 +++ qemu/hw/pci-hotplug.c 2009-02-23 18:33:43.000000000 +1100 @@ -112,7 +112,7 @@ static PCIDevice *qemu_pci_hot_add_stora switch (type) { case IF_SCSI: - opaque = lsi_scsi_init (pci_bus, -1); + opaque = lsi_scsi_init (pci_bus); if (opaque && drive_idx >= 0) lsi_scsi_attach (opaque, drives_table[drive_idx].bdrv, drives_table[drive_idx].unit); -- -- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en