From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbcIVBGc (ORCPT ); Wed, 21 Sep 2016 21:06:32 -0400 Received: from smtpbg65.qq.com ([103.7.28.233]:12286 "EHLO smtpbg65.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751635AbcIVBGb (ORCPT ); Wed, 21 Sep 2016 21:06:31 -0400 X-QQ-mid: esmtp28t1474506368t966bkfuh X-QQ-SSF: 01000000000000F0F9200F000000000 X-QQ-FEAT: Me8Xob1wlXKdYE2Sn6Rl8LyhaggfmoIBEEfx4OGJnhHwXRh+bOfix6likITTy zDjl9s4dZvYx7lYtc2YjhL97k0A7LpPRaGTJn+CbpoNjHFFlkpfrqDc+V2pXMDQRewz2bBU SA+8w9F2qKvlrGcJcKxtno4iCWuGCldLc+e7A4JXQqq3Ll9RJUPOniALltzue8TFkWBMnCS d5FhLXDvbfO2uX+1S6qHSoDPAAH/ydwVBZK6aYKdhpDJdeoLkqJF8MaKu8yRgC/Y3GplsPf dMAf2jcvqZSN+M X-QQ-GoodBg: 0 From: Wang Sheng-Hui To: yu.zhao@intel.com, jbarnes@virtuousgeek.org, alex.williamson@redhat.com Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h Date: Thu, 22 Sep 2016 09:05:46 +0800 Message-Id: <1474506346-20873-1-git-send-email-shhuiw@foxmail.com> X-Mailer: git-send-email 2.7.4 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign1 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a cleanup that moves PCI configuration space size macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from drivers/pci/pci.h to include/uapi/linux/pci_regs.h So that the macros can be used by more drivers and eliminate potential duplicate definition. Signed-off-by: Wang Sheng-Hui --- drivers/pci/pci.h | 3 --- drivers/vfio/pci/vfio_pci_config.c | 2 -- include/uapi/linux/pci_regs.h | 7 +++++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 9730c47..12d651a 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -1,9 +1,6 @@ #ifndef DRIVERS_PCI_H #define DRIVERS_PCI_H -#define PCI_CFG_SPACE_SIZE 256 -#define PCI_CFG_SPACE_EXP_SIZE 4096 - #define PCI_FIND_CAP_TTL 48 extern const unsigned char pcie_link_speed[]; diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index 688691d..8dc8a5a 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -31,8 +31,6 @@ #include "vfio_pci_private.h" -#define PCI_CFG_SPACE_SIZE 256 - /* Fake capability ID for standard config space */ #define PCI_CAP_ID_BASIC 0 diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 4040951..a07c53c 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -23,6 +23,13 @@ #define LINUX_PCI_REGS_H /* + * Under PCI, each device has 256 bytes of configuration address space. + * Under PCIe, each device has 4096 bytes of configuration address space. + */ +#define PCI_CFG_SPACE_SIZE 256 +#define PCI_CFG_SPACE_EXP_SIZE 4096 + +/* * Under PCI, each device has 256 bytes of configuration address space, * of which the first 64 bytes are standardized as follows: */ -- 2.7.4