[RFC 21/47] drivers/bus: replace use of sys/queue.h

Stephen Hemminger
2025-08-18T23:34:48Z

Prefer just using rte_tailq.h when TAILQ macro's are used.
Other places eliminate sys/queue.h if possible.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/bus/auxiliary/auxiliary_common.c | 2 +-
drivers/bus/auxiliary/private.h | 2 +-
drivers/bus/ifpga/ifpga_bus.c | 2 +-
drivers/bus/pci/bsd/pci.c | 2 +-
drivers/bus/pci/pci_common.c | 1 -
drivers/bus/pci/pci_params.c | 2 --
drivers/bus/pci/windows/pci.c | 3 +--
drivers/bus/pci/windows/pci_netuio.c | 2 --
drivers/bus/platform/platform.c | 2 +-
drivers/bus/vdev/vdev.c | 1 -
drivers/bus/vmbus/vmbus_common.c | 1 -
11 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c
index ac766e283e..4edc621268 100644
--- a/drivers/bus/auxiliary/auxiliary_common.c
+++ b/drivers/bus/auxiliary/auxiliary_common.c
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/queue.h>
+
#include <eal_export.h>
#include <rte_errno.h>
#include <rte_interrupts.h>
diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h
index 4604f6f4a7..808426c4a3 100644
--- a/drivers/bus/auxiliary/private.h
+++ b/drivers/bus/auxiliary/private.h
@@ -7,9 +7,9 @@

#include <stdbool.h>
#include <stdio.h>
-#include <sys/queue.h>

#include <bus_driver.h>
+#include <bsd_queue.h>

#include "bus_auxiliary_driver.h"

diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index ca9e49f548..3af95921a7 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -7,7 +7,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/queue.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
@@ -26,6 +25,7 @@
#include <rte_alarm.h>
#include <rte_string_fns.h>
#include <rte_debug.h>
+#include <rte_tailq.h>

#include "rte_rawdev.h"
#include "rte_rawdev_pmd.h"
diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index 3f13e1d6ac..97214ea049 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -15,7 +15,6 @@
#include <errno.h>
#include <dirent.h>
#include <limits.h>
-#include <sys/queue.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/pciio.h>
@@ -38,6 +37,7 @@
#include <rte_string_fns.h>
#include <rte_debug.h>
#include <rte_devargs.h>
+#include <rte_tailq.h>

#include <eal_export.h>
#include "eal_filesystem.h"
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index c88634f790..2898f8d9c7 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -9,7 +9,6 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/queue.h>
#include <eal_export.h>
#include <rte_errno.h>
#include <rte_interrupts.h>
diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 087ec38bb9..0b6d944118 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -2,8 +2,6 @@
* Copyright 2018 Gaëtan Rivet
*/

-#include <sys/queue.h>
-
#include <bus_driver.h>
#include <rte_bus_pci.h>
#include <dev_driver.h>
diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index e7e449306e..18e5f5369e 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -2,8 +2,6 @@
* Copyright 2020 Mellanox Technologies, Ltd
*/

-#include <sys/queue.h>
-
#include <eal_export.h>
#include <rte_windows.h>
#include <rte_errno.h>
@@ -11,6 +9,7 @@
#include <rte_eal.h>
#include <rte_memory.h>
#include <rte_bus_pci.h>
+#include <rte_tailq.h>

#include "private.h"
#include "pci_netuio.h"
diff --git a/drivers/bus/pci/windows/pci_netuio.c b/drivers/bus/pci/windows/pci_netuio.c
index 346b2f4c0a..d3d7e1f504 100644
--- a/drivers/bus/pci/windows/pci_netuio.c
+++ b/drivers/bus/pci/windows/pci_netuio.c
@@ -2,8 +2,6 @@
* Copyright(c) 2020 Intel Corporation.
*/

-#include <sys/queue.h>
-
#include <rte_windows.h>
#include <rte_errno.h>
#include <rte_log.h>
diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index 0f50027236..b47c41c18b 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -8,7 +8,6 @@
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <sys/queue.h>
#include <unistd.h>

#include <bus_driver.h>
@@ -21,6 +20,7 @@
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_string_fns.h>
+#include <rte_tailq.h>
#include <rte_vfio.h>

#include "private.h"
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index be375f63dc..85df5f02c6 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -8,7 +8,6 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
-#include <sys/queue.h>

#include <eal_export.h>
#include <rte_eal.h>
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index a787d8b18d..8a987a7d0e 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -7,7 +7,6 @@
#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
-#include <sys/queue.h>
#include <sys/mman.h>

#include <eal_export.h>
--
2.47.2