pci: a couple more cleanups
cover pci: a couple more cleanups
This is follow on to earlier PCI patches to remove unused functions
Stephen Hemminger (2):
pci: make rte_pci_remove_device static
pci: remove unused function prototype
drivers/bus/pci/pci_common.c | 5 ++++- drivers/bus/pci/private.h | 20 -------------------- 2 files changed, 4 insertions(+), 21 deletions(-)
Signature · 1 line
2.17.0
PATCH 1/2 pci: make rte_pci_remove_device static
Only used in one file, and therefore can be made static.
--- drivers/bus/pci/pci_common.c | 5 ++++- drivers/bus/pci/private.h | 10 ---------- 2 files changed, 4 insertions(+), 11 deletions(-)
drivers/bus/pci/pci_common.c +4 -1
@@ -26,6 +26,9 @@#include "private.h" + +static void rte_pci_remove_device (struct rte_pci_device *pci_device); +extern struct rte_pci_bus rte_pci_bus;#define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
@@ -445,7 +448,7 @@ rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, }/* Remove a device from PCI bus */ -void +static void rte_pci_remove_device (struct rte_pci_device *pci_dev) {TAILQ_REMOVE (&rte_pci_bus.device_list, pci_dev, next);
drivers/bus/pci/private.h +0 -10
@@ -93,16 +93,6 @@ void rte_pci_add_device(struct rte_pci_device *pci_dev);void rte_pci_insert_device (struct rte_pci_device *exist_pci_dev,struct rte_pci_device *new_pci_dev); -/** -* Remove a PCI device from the PCI Bus. This sets to NULL the bus references -* in the PCI device object as well as the generic device object. -* -* @param pci_device -* PCI device to be removed from PCI Bus -* @return void -*/ -void rte_pci_remove_device (struct rte_pci_device *pci_device); -/** * Update a pci device object by asking the kernel for the latest information. *
Signature · 1 line
2.17.0
Re: [PATCH 1/2] pci: make rte_pci_remove_device static
Hello Stephen,
Quoted 3 lines · Stephen Hemminger
Only used in one file, and therefore can be made static.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 52 lines
--- drivers/bus/pci/pci_common.c | 5 ++++- drivers/bus/pci/private.h | 10 ---------- 2 files changed, 4 insertions(+), 11 deletions(-)drivers/bus/pci/pci_common.c +4
-1@@ -26,6 +26,9 @@#include "private.h" + +static void rte_pci_remove_device (struct rte_pci_device *pci_device); +extern struct rte_pci_bus rte_pci_bus;#define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"@@ -445,7 +448,7 @@ rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, }/* Remove a device from PCI bus */ -void +static void rte_pci_remove_device (struct rte_pci_device *pci_dev) {TAILQ_REMOVE (&rte_pci_bus.device_list, pci_dev, next);drivers/bus/pci/private.h +0
-10@@ -93,16 +93,6 @@ void rte_pci_add_device(struct rte_pci_device *pci_dev);void rte_pci_insert_device (struct rte_pci_device *exist_pci_dev,struct rte_pci_device *new_pci_dev); -/** -* Remove a PCI device from the PCI Bus. This sets to NULL the bus references -* in the PCI device object as well as the generic device object. -* -* @param pci_device -* PCI device to be removed from PCI Bus -* @return void -*/ -void rte_pci_remove_device (struct rte_pci_device *pci_device); -/** * Update a pci device object by asking the kernel for the latest information. * Signature · 1 line
2.17.0
Signature · 2 lines
Gaëtan Rivet 6WIND
PATCH 2/2 pci: remove unused function prototype
In reply to Stephen HemmingerPrototype for pci_unbind_kernel_driver exists but no code.
--- drivers/bus/pci/private.h | 10 ---------- 1 file changed, 10 deletions(-)
drivers/bus/pci/private.h +0 -10
@@ -106,16 +106,6 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev,*/ int pci_update_device (const struct rte_pci_addr *addr); -/** -* Unbind kernel driver for this device -* -* This function is private to EAL. -* -* @return -* 0 on success, negative on error -*/ -int pci_unbind_kernel_driver (struct rte_pci_device *dev); -/** * Map the PCI resource of a PCI device in virtual memory *
Signature · 1 line
2.17.0
Re: [PATCH 2/2] pci: remove unused function prototype
Quoted 3 lines · Stephen Hemminger
Prototype for
pci_unbind_kernel_driverexists but no code.Signed-off-by Stephen Hemminger <[email protected]>
Quoted 28 lines
--- drivers/bus/pci/private.h | 10 ---------- 1 file changed, 10 deletions(-)drivers/bus/pci/private.h +0
-10@@ -106,16 +106,6 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev,*/ int pci_update_device (const struct rte_pci_addr *addr); -/** -* Unbind kernel driver for this device -* -* This function is private to EAL. -* -* @return -* 0 on success, negative on error -*/ -int pci_unbind_kernel_driver (struct rte_pci_device *dev); -/** * Map the PCI resource of a PCI device in virtual memory * Signature · 1 line
2.17.0
Signature · 2 lines
Gaëtan Rivet 6WIND
Thomas Monjalon
AppliedRe: [PATCH 2/2] pci: remove unused function prototype
22/05/2018 11:00, Gaëtan Rivet:
Quoted 5 lines · Stephen Hemminger
Quoted 3 lines
Prototype for
pci_unbind_kernel_driverexists but no code.Signed-off-by Stephen Hemminger <[email protected]>Acked-by Gaetan Rivet <[email protected]>
It was a leftover of an old incomplete cleanup.
Applied, thanks