aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-06 23:45:27 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-06 23:45:27 +0000
commit7650d4b67e53d3916313eb23d618cac50fdec9cc (patch)
tree4a45c36d445040d71e2f78edccee7d1862d88276
parent92ca0e81b8a984e919a6162803ac467d06e0f28d (diff)
downloadsrc-7650d4b67e53d3916313eb23d618cac50fdec9cc.tar.gz
src-7650d4b67e53d3916313eb23d618cac50fdec9cc.zip
xen netback: Remove write-only variables.
-rw-r--r--sys/dev/xen/netback/netback.c4
-rw-r--r--sys/dev/xen/netback/netback_unit_tests.c12
2 files changed, 5 insertions, 11 deletions
diff --git a/sys/dev/xen/netback/netback.c b/sys/dev/xen/netback/netback.c
index bf54f3a2f28e..bcc7d2541203 100644
--- a/sys/dev/xen/netback/netback.c
+++ b/sys/dev/xen/netback/netback.c
@@ -2393,7 +2393,7 @@ xnb_send(netif_rx_back_ring_t *ring, domid_t otherend, const struct mbuf *mbufc,
gnttab_copy_table gnttab)
{
struct xnb_pkt pkt;
- int error, n_entries, n_reqs;
+ int error, n_entries;
RING_IDX space;
space = ring->sring->req_prod - ring->req_cons;
@@ -2408,7 +2408,7 @@ xnb_send(netif_rx_back_ring_t *ring, domid_t otherend, const struct mbuf *mbufc,
hv_ret));
}
- n_reqs = xnb_rxpkt2rsp(&pkt, gnttab, n_entries, ring);
+ xnb_rxpkt2rsp(&pkt, gnttab, n_entries, ring);
return 0;
}
diff --git a/sys/dev/xen/netback/netback_unit_tests.c b/sys/dev/xen/netback/netback_unit_tests.c
index ace143e064ea..82af6ba89f11 100644
--- a/sys/dev/xen/netback/netback_unit_tests.c
+++ b/sys/dev/xen/netback/netback_unit_tests.c
@@ -648,15 +648,13 @@ xnb_ring2pkt_wraps(char *buffer, size_t buflen)
static void
xnb_txpkt2rsp_emptypkt(char *buffer, size_t buflen)
{
- int num_consumed;
struct xnb_pkt pkt;
netif_tx_back_ring_t txb_backup = xnb_unit_pvt.txb;
netif_tx_sring_t txs_backup = *xnb_unit_pvt.txs;
pkt.list_len = 0;
/* must call xnb_ring2pkt just to intialize pkt */
- num_consumed = xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb,
- xnb_unit_pvt.txb.req_cons);
+ xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb, xnb_unit_pvt.txb.req_cons);
xnb_txpkt2rsp(&pkt, &xnb_unit_pvt.txb, 0);
XNB_ASSERT(
memcmp(&txb_backup, &xnb_unit_pvt.txb, sizeof(txb_backup)) == 0);
@@ -901,7 +899,6 @@ static void
xnb_txpkt2rsp_wraps(char *buffer, size_t buflen)
{
struct xnb_pkt pkt;
- int num_consumed;
struct netif_tx_request *req;
struct netif_tx_response *rsp;
unsigned int rsize;
@@ -943,8 +940,7 @@ xnb_txpkt2rsp_wraps(char *buffer, size_t buflen)
RING_PUSH_REQUESTS(&xnb_unit_pvt.txf);
- num_consumed = xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb,
- xnb_unit_pvt.txb.req_cons);
+ xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb, xnb_unit_pvt.txb.req_cons);
xnb_txpkt2rsp(&pkt, &xnb_unit_pvt.txb, 0);
@@ -986,14 +982,12 @@ xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags)
static void
xnb_pkt2mbufc_empty(char *buffer, size_t buflen)
{
- int num_consumed;
struct xnb_pkt pkt;
struct mbuf *pMbuf;
pkt.list_len = 0;
/* must call xnb_ring2pkt just to intialize pkt */
- num_consumed = xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb,
- xnb_unit_pvt.txb.req_cons);
+ xnb_ring2pkt(&pkt, &xnb_unit_pvt.txb, xnb_unit_pvt.txb.req_cons);
pkt.size = 0;
pMbuf = xnb_pkt2mbufc(&pkt, xnb_unit_pvt.ifp);
safe_m_freem(&pMbuf);