From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Gordeev Subject: [kvm-unit-tests PATCH v11 02/12] pci: x86: Rename pci_config_read() to pci_config_readl() Date: Mon, 7 Nov 2016 11:14:34 +0100 Message-ID: References: Cc: Alexander Gordeev , Thomas Huth , Andrew Jones , Peter Xu To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43952 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbcKGKOv (ORCPT ); Mon, 7 Nov 2016 05:14:51 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 A252361BBD for ; Mon, 7 Nov 2016 10:14:51 +0000 (UTC) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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 43cd0ea4f2fa..e0b4514244f6 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 cddde41a7d97..d00438fe91e4 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); -- 1.8.3.1