Skip to contentSkip to conversation

xen-netback: remove unused variables pending_idx and index

PATCH Applied Tom Rix 4 participants 4 messages Feb 26, 2023 – Feb 28, 2023

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 xen-netback: remove unused variables pending_idx and index

building with gcc and W=1 reports drivers/net/xen-netback/netback.c:886:21: error: variable
‘pending_idx’ set but not used [-Werror=unused-but-set-variable]

  886 |                 u16 pending_idx;
      |                     ^~~~~~~~~~~

pending_idx is not used so remove it. Since index was only used to set pending_idx, remove index as well.

---
 drivers/net/xen-netback/netback.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/xen-netback/netback.c +0 -5
index bf627af723bf..1b42676ca141 100644
@@ -883,11 +883,9 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
 		struct xen_netif_tx_request txfrags[XEN_NETBK_LEGACY_SLOTS_MAX];
 		struct xen_netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX-1];
 		unsigned int extra_count;
-		u16 pending_idx;
 		RING_IDX idx;
 		int work_to_do;
 		unsigned int data_len;
-		pending_ring_idx_t index;
 
 		if (queue->tx.sring->req_prod - queue->tx.req_cons >
 		    XEN_NETIF_TX_RING_SIZE) {
@@ -983,9 +981,6 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
 			break;
 		}
 
-		index = pending_index(queue->pending_cons);
-		pending_idx = queue->pending_ring[index];
-
 		if (ret >= XEN_NETBK_LEGACY_SLOTS_MAX - 1 && data_len < txreq.size)
 			data_len = txreq.size;
 
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Tom Rix

building with gcc and W=1 reports drivers/net/xen-netback/netback.c:886:21: error: variable
‘pending_idx’ set but not used [-Werror=unused-but-set-variable]

   886 |                 u16 pending_idx;
       |                     ^~~~~~~~~~~

pending_idx is not used so remove it. Since index was only used to set pending_idx, remove index as well.

Juergen

maintainer Applied
#2 lore raw
Quoted 7 lines · On Mon, 27 Feb 2023 09:29:30 +0100 Juergen Gross wrote:
Quoted 6 lines · Tom Rix

building with gcc and W=1 reports drivers/net/xen-netback/netback.c:886:21: error: variable
‘pending_idx’ set but not used [-Werror=unused-but-set-variable]

   886 |                 u16 pending_idx;
       |                     ^~~~~~~~~~~
Quoted 6 lines
Quoted 4 lines

pending_idx is not used so remove it. Since index was only used to set pending_idx, remove index as well.

Applied, thanks!

#3 lore raw
In reply to Tom Rix
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Sun, 26 Feb 2023 11:34:29 -0500 you wrote:

building with gcc and W=1 reports drivers/net/xen-netback/netback.c:886:21: error: variable
‘pending_idx’ set but not used [-Werror=unused-but-set-variable]

  886 |                 u16 pending_idx;
      |                     ^~~~~~~~~~~

pending_idx is not used so remove it. Since index was only used to set pending_idx, remove index as well.

[...]

Here is the summary with links:
- xen-netback: remove unused variables pending_idx and index

    https://git.kernel.org/netdev/net-next/c/ccf8f7d71424

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html