public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Remove redundant macro
@ 2024-12-13  9:46 zhangdongdong
  2024-12-13 17:37 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: zhangdongdong @ 2024-12-13  9:46 UTC (permalink / raw)
  To: alex.williamson
  Cc: bhelgaas, zhangdongdong, yishaih, avihaih, yi.l.liu, ankita, kvm,
	linux-kernel, linux-pci

From: Dongdong Zhang <zhangdongdong@eswincomputing.com>

Removed the duplicate macro definition PCI_VSEC_HDR from
pci_regs.h to avoid redundancy. Updated the VFIO PCI code
to use the existing `PCI_VNDR_HEADER` macro for consistency,
ensuring minimal changes to the codebase.

Signed-off-by: Dongdong Zhang <zhangdongdong@eswincomputing.com>
---
 drivers/vfio/pci/vfio_pci_config.c | 3 ++-
 include/uapi/linux/pci_regs.h      | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
index ea2745c1ac5e..c30748912ff1 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_config.c
@@ -1389,7 +1389,8 @@ static int vfio_ext_cap_len(struct vfio_pci_core_device *vdev, u16 ecap, u16 epo
 
 	switch (ecap) {
 	case PCI_EXT_CAP_ID_VNDR:
-		ret = pci_read_config_dword(pdev, epos + PCI_VSEC_HDR, &dword);
+		ret = pci_read_config_dword(pdev, epos + PCI_VNDR_HEADER,
+					    &dword);
 		if (ret)
 			return pcibios_err_to_errno(ret);
 
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 1601c7ed5fab..7b6cad788de3 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -1001,7 +1001,6 @@
 #define PCI_ACS_CTRL		0x06	/* ACS Control Register */
 #define PCI_ACS_EGRESS_CTL_V	0x08	/* ACS Egress Control Vector */
 
-#define PCI_VSEC_HDR		4	/* extended cap - vendor-specific */
 #define  PCI_VSEC_HDR_LEN_SHIFT	20	/* shift for length field */
 
 /* SATA capability */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-16  1:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13  9:46 [PATCH] PCI: Remove redundant macro zhangdongdong
2024-12-13 17:37 ` Bjorn Helgaas
2024-12-16  1:22   ` DongdongZhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox