From patchwork Mon Nov 14 22:18:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9428517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C4BD60755 for ; Mon, 14 Nov 2016 22:19:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E5A82874C for ; Mon, 14 Nov 2016 22:19:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F37028A06; Mon, 14 Nov 2016 22:19:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D289F28A06 for ; Mon, 14 Nov 2016 22:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941048AbcKNWTa (ORCPT ); Mon, 14 Nov 2016 17:19:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59630 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941030AbcKNWT2 (ORCPT ); Mon, 14 Nov 2016 17:19:28 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8382811D8; Mon, 14 Nov 2016 22:19:27 +0000 (UTC) Received: from pxdev.xzpeter.org.com (vpn-63-110.rdu2.redhat.com [10.10.63.110]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAEMJOti017899; Mon, 14 Nov 2016 17:19:27 -0500 From: Peter Xu To: kvm@vger.kernel.org Cc: drjones@redhat.com, agordeev@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, pbonzini@redhat.com, peterx@redhat.com Subject: [PATCH v3 02/25] pci: x86: Rename pci_config_read() to pci_config_readl() Date: Mon, 14 Nov 2016 17:18:58 -0500 Message-Id: <1479161961-20304-3-git-send-email-peterx@redhat.com> In-Reply-To: <1479161961-20304-1-git-send-email-peterx@redhat.com> References: <1479161961-20304-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Nov 2016 22:19:27 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexander Gordeev Cc: Thomas Huth Cc: Andrew Jones Cc: Peter Xu Reviewed-by: Thomas Huth Reviewed-by: Andrew Jones Signed-off-by: Alexander Gordeev --- lib/pci.c | 8 ++++---- lib/x86/asm/pci.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pci.c b/lib/pci.c index 43cd0ea..e0b4514 100644 --- a/lib/pci.c +++ b/lib/pci.c @@ -13,7 +13,7 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id) pcidevaddr_t dev; for (dev = 0; dev < 256; ++dev) { - uint32_t id = pci_config_read(dev, 0); + uint32_t id = pci_config_readl(dev, 0); if ((id & 0xFFFF) == vendor_id && (id >> 16) == device_id) return dev; @@ -24,7 +24,7 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id) unsigned long pci_bar_addr(pcidevaddr_t dev, int bar_num) { - uint32_t bar = pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); + uint32_t bar = pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); if (bar & PCI_BASE_ADDRESS_SPACE_IO) return bar & PCI_BASE_ADDRESS_IO_MASK; @@ -34,12 +34,12 @@ unsigned long pci_bar_addr(pcidevaddr_t dev, int bar_num) bool pci_bar_is_memory(pcidevaddr_t dev, int bar_num) { - uint32_t bar = pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); + uint32_t bar = pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); return !(bar & PCI_BASE_ADDRESS_SPACE_IO); } bool pci_bar_is_valid(pcidevaddr_t dev, int bar_num) { - return pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); + return pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4); } diff --git a/lib/x86/asm/pci.h b/lib/x86/asm/pci.h index cddde41..d00438f 100644 --- a/lib/x86/asm/pci.h +++ b/lib/x86/asm/pci.h @@ -9,7 +9,7 @@ #include "pci.h" #include "x86/asm/io.h" -static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t reg) +static inline uint32_t pci_config_readl(pcidevaddr_t dev, uint8_t reg) { uint32_t index = reg | (dev << 8) | (0x1 << 31); outl(index, 0xCF8);