[PATCH v2 3/4] common/zsda: remove unused device counter

Stephen Hemminger stephen at networkplumber.org
Sat Aug 29 17:44:47 CEST 2026


zsda_nb_pci_devices is incremented when a PCI device is allocated and
decremented when it is released, but the count is never read.

clang 23 reports:

  zsda_device.c:10:12: warning: variable 'zsda_nb_pci_devices' set but
        not used [-Wunused-but-set-global]

Remove the counter and the three sites that update it.

Fixes: 6592da5893d3 ("common/zsda: add base driver")
Cc: stable at dpdk.org

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
The CI AI review of this patch was hallucinating and
fabricated functions that don't exist.

 drivers/common/zsda/zsda_device.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/common/zsda/zsda_device.c b/drivers/common/zsda/zsda_device.c
index 72f017c699..280a51f9b3 100644
--- a/drivers/common/zsda/zsda_device.c
+++ b/drivers/common/zsda/zsda_device.c
@@ -7,7 +7,6 @@
 
 /* per-process array of device data */
 struct zsda_device_info zsda_devs[RTE_PMD_ZSDA_MAX_PCI_DEVICES];
-static int zsda_nb_pci_devices;
 
 /*
  * The set of PCI devices this driver supports
@@ -85,7 +84,6 @@ zsda_pci_device_allocate(struct rte_pci_device *pci_dev)
 		zsda_pci_dev = mz->addr;
 		zsda_devs[zsda_pci_dev->zsda_dev_id].mz = mz;
 		zsda_devs[zsda_pci_dev->zsda_dev_id].pci_dev = pci_dev;
-		zsda_nb_pci_devices++;
 		return zsda_pci_dev;
 	}
 
@@ -114,8 +112,6 @@ zsda_pci_device_allocate(struct rte_pci_device *pci_dev)
 	zsda_pci_dev->pci_dev = pci_dev;
 	zsda_devs[zsda_dev_id].pci_dev = pci_dev;
 
-	zsda_nb_pci_devices++;
-
 	return zsda_pci_dev;
 }
 
@@ -141,7 +137,6 @@ zsda_pci_device_release(const struct rte_pci_device *pci_dev)
 			rte_memzone_free(inst->mz);
 
 		memset(inst, 0, sizeof(struct zsda_device_info));
-		zsda_nb_pci_devices--;
 	}
 	return 0;
 }
-- 
2.53.0



More information about the dev mailing list