From 58292bae47ec0a774fc6f4b8649732bdbc72029a Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 28 Nov 2023 16:02:00 +0100 Subject: [PATCH] virpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The VIR_PF_PHYS_PORT_NAME_REGEX macro is used only in virPCIGetNetName() and nowhere else. It's not necessary to expose it in the header file. Signed-off-by: Michal Privoznik Reviewed-by: Jonathon Jongsma Reviewed-by: Ján Tomko --- src/util/virpci.c | 8 ++++++++ src/util/virpci.h | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index baacde4c14..eae698c0a0 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2536,6 +2536,12 @@ virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddress *addr, return 0; } + +/* Represents format of PF's phys_port_name in switchdev mode: + * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file. + */ +# define VIR_PF_PHYS_PORT_NAME_REGEX "(p[0-9]+$)|(p[0-9]+s[0-9]+$)" + /** * virPCIGetNetName: * @device_link_sysfs_path: sysfs path to the PCI device @@ -2661,6 +2667,8 @@ virPCIGetNetName(const char *device_link_sysfs_path, return -1; } +# undef VIR_PF_PHYS_PORT_NAME_REGEX + int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, int pfNetDevIdx, diff --git a/src/util/virpci.h b/src/util/virpci.h index faca6cf6f9..e964a2685c 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -52,11 +52,6 @@ struct _virZPCIDeviceAddress { #define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d" -/* Represents format of PF's phys_port_name in switchdev mode: - * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file. - */ -#define VIR_PF_PHYS_PORT_NAME_REGEX "(p[0-9]+$)|(p[0-9]+s[0-9]+$)" - struct _virPCIDeviceAddress { unsigned int domain; unsigned int bus;