Skip to contentSkip to conversation

pci: a couple more cleanups

PATCH Applied Stephen Hemminger 3 participants 6 messages May 21, 2018 – Jun 27, 2018

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 7215aaec3add..d3ac04a8f00f 100644
@@ -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
index 88fa587e74dc..02e2fb44367f 100644
@@ -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
Acked-by on v1 1/2
#2 lore raw

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.

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
index 7215aaec3add..d3ac04a8f00f 100644
@@ -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
index 88fa587e74dc..02e2fb44367f 100644
@@ -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
#3 lore raw

PATCH 2/2 pci: remove unused function prototype

In reply to Stephen Hemminger

Prototype 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
index 02e2fb44367f..680879ed35a2 100644
@@ -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
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] pci: remove unused function prototype

Quoted 3 lines · Stephen Hemminger

Prototype for pci_unbind_kernel_driver exists but no code.

Quoted 28 lines
---
 drivers/bus/pci/private.h | 10 ----------
 1 file changed, 10 deletions(-)
drivers/bus/pci/private.h +0 -10
index 02e2fb44367f..680879ed35a2 100644
@@ -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