From patchwork Tue Jul 27 06:24:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 59975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03C3FB6EE9 for ; Tue, 27 Jul 2010 16:27:12 +1000 (EST) Received: from localhost ([127.0.0.1]:41449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oddct-0004ZM-Dh for incoming@patchwork.ozlabs.org; Tue, 27 Jul 2010 02:26:55 -0400 Received: from [140.186.70.92] (port=37060 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OddYE-0002qo-B5 for qemu-devel@nongnu.org; Tue, 27 Jul 2010 02:22:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OddXK-0007k8-7j for qemu-devel@nongnu.org; Tue, 27 Jul 2010 02:21:11 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:40558) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OddXJ-0007k0-Pt for qemu-devel@nongnu.org; Tue, 27 Jul 2010 02:21:10 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id F12AB107908; Tue, 27 Jul 2010 15:21:08 +0900 (JST) Received: (nullmailer pid 31065 invoked by uid 1000); Tue, 27 Jul 2010 06:24:47 -0000 Date: Tue, 27 Jul 2010 15:24:47 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org Message-ID: <20100727062447.GC5690@valinux.co.jp> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Huacai Chen , Aurelien Jarno Subject: [Qemu-devel] [PATCH] mips64el: fulong: PCI_DEVFN() clean up. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use PCI_DEVFN() where appropriate. The resulted stripped binary remains same with/without thie patch. Cc: Huacai Chen Cc: Aurelien Jarno Signed-off-by: Isaku Yamahata --- hw/mips_fulong2e.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c index a9bbff6..c6c13ca 100644 --- a/hw/mips_fulong2e.c +++ b/hw/mips_fulong2e.c @@ -219,8 +219,8 @@ uint8_t eeprom_spd[0x80] = { #ifdef HAS_AUDIO static void audio_init (PCIBus *pci_bus) { - vt82c686b_ac97_init(pci_bus, (FULONG2E_VIA_SLOT << 3) + 5); - vt82c686b_mc97_init(pci_bus, (FULONG2E_VIA_SLOT << 3) + 6); + vt82c686b_ac97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 5)); + vt82c686b_mc97_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 6)); } #endif @@ -349,18 +349,18 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device, hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS); } - via_devfn = vt82c686b_init(pci_bus, FULONG2E_VIA_SLOT << 3); + via_devfn = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0)); if (via_devfn < 0) { fprintf(stderr, "vt82c686b_init error \n"); exit(1); } isa_bus_irqs(i8259); - vt82c686b_ide_init(pci_bus, hd, (FULONG2E_VIA_SLOT << 3) + 1); - usb_uhci_vt82c686b_init(pci_bus, (FULONG2E_VIA_SLOT << 3) + 2); - usb_uhci_vt82c686b_init(pci_bus, (FULONG2E_VIA_SLOT << 3) + 3); + vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(FULONG2E_VIA_SLOT, 1)); + usb_uhci_vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2)); + usb_uhci_vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 3)); - smbus = vt82c686b_pm_init(pci_bus, (FULONG2E_VIA_SLOT << 3) + 4, + smbus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 4), 0xeee1, NULL); eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */ memcpy(eeprom_buf, eeprom_spd, sizeof(eeprom_spd));