vfio: fix build with Linux < 4.0

Message ID 20181118212914.29280-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers
Series vfio: fix build with Linux < 4.0 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon Nov. 18, 2018, 9:29 p.m. UTC
  drivers/bus/pci/linux/pci_vfio.c:45:23: error:
‘failure_handle_lock’ defined but not used

Fixes: 8ffe73865124 ("vfio: add lock for hot-unplug failure handler")
Cc: jia.guo@intel.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---

Applied immediately.

---
 drivers/bus/pci/linux/pci_vfio.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Comments

Anatoly Burakov Nov. 19, 2018, 10:06 a.m. UTC | #1
On 18-Nov-18 9:29 PM, Thomas Monjalon wrote:
> drivers/bus/pci/linux/pci_vfio.c:45:23: error:
> ‘failure_handle_lock’ defined but not used
> 
> Fixes: 8ffe73865124 ("vfio: add lock for hot-unplug failure handler")
> Cc: jia.guo@intel.com
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> 
> Applied immediately.
> 
Ack for posterity :)

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  

Patch

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index d2c84106f..ffd26f195 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -36,14 +36,6 @@ 
  * This file is only compiled if CONFIG_RTE_EAL_VFIO is set to "y".
  */
 
-/*
- * spinlock for device hot-unplug failure handling. If it try to access bus or
- * device, such as handle sigbus on bus or handle memory failure for device
- * just need to use this lock. It could protect the bus and the device to avoid
- * race condition.
- */
-static rte_spinlock_t failure_handle_lock = RTE_SPINLOCK_INITIALIZER;
-
 #ifdef VFIO_PRESENT
 
 #ifndef PAGE_SIZE
@@ -291,6 +283,14 @@  pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
 }
 
 #ifdef HAVE_VFIO_DEV_REQ_INTERFACE
+/*
+ * Spinlock for device hot-unplug failure handling.
+ * If it tries to access bus or device, such as handle sigbus on bus
+ * or handle memory failure for device, just need to use this lock.
+ * It could protect the bus and the device to avoid race condition.
+ */
+static rte_spinlock_t failure_handle_lock = RTE_SPINLOCK_INITIALIZER;
+
 static void
 pci_vfio_req_handler(void *param)
 {