dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	stable@dpdk.org, Chengfei Han <han.chengfei@zte.com.cn>,
	Ming Ran <ran.ming@zte.com.cn>,
	Hanxiao Li <li.hanxiao@zte.com.cn>,
	Akhil Goyal <gakhil@marvell.com>
Subject: [PATCH 3/4] common/zsda: remove unused device counter
Date: Wed, 26 Aug 2026 16:43:03 -0700	[thread overview]
Message-ID: <20260826235933.194681-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20260826235933.194681-1-stephen@networkplumber.org>

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@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 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


  parent reply	other threads:[~2026-08-27  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 23:43 [PATCH 0/4] fix unused-but-set-global warnings Stephen Hemminger
2026-08-26 23:43 ` [PATCH 1/4] common/dpaax: fix unused variable warning in non-debug build Stephen Hemminger
2026-08-27  9:07   ` David Marchand
2026-08-27 14:57     ` Stephen Hemminger
2026-08-27 15:55       ` Hemant Agrawal
2026-08-26 23:43 ` [PATCH 2/4] bus/dpaa: remove unused qman_clk variable Stephen Hemminger
2026-08-27 15:57   ` Hemant Agrawal
2026-08-26 23:43 ` Stephen Hemminger [this message]
2026-08-26 23:43 ` [PATCH 4/4] net/qede: remove unused app version variable Stephen Hemminger
2026-08-27  9:08   ` David Marchand
2026-08-27 14:59     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260826235933.194681-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=han.chengfei@zte.com.cn \
    --cc=li.hanxiao@zte.com.cn \
    --cc=ran.ming@zte.com.cn \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).