Skip to contentSkip to conversation

lan743x: remove redundant assignment to variable rx_process_result

PATCH Applied Colin King 2 participants 2 messages Sep 5, 2019 – Sep 6, 2019

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 lan743x: remove redundant assignment to variable rx_process_result

From: Colin Ian King <[email protected]>

The variable rx_process_result is being initialized with a value that is never read and is being re-assigned immediately afterwards. The assignment is redundant, so replace it with the return from function lan743x_rx_process_packet.

Addresses-Coverity: ("Unused value")

---
 drivers/net/ethernet/microchip/lan743x_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +1 -2
index 15a8be6bad27..a43140f7b5eb 100644
@@ -2172,9 +2172,8 @@ static int lan743x_rx_napi_poll(struct napi_struct *napi, int weight)
 	}
 	count = 0;
 	while (count < weight) {
-		int rx_process_result = -1;
+		int rx_process_result = lan743x_rx_process_packet(rx);
 
-		rx_process_result = lan743x_rx_process_packet(rx);
 		if (rx_process_result = RX_PROCESS_RESULT_PACKET_RECEIVED) {
 			count++;
 		} else if (rx_process_result =
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw

From: Colin King <[email protected]>
Date: Thu, 5 Sep 2019 15:01:35 +0100

Quoted 9 lines

From: Colin Ian King <[email protected]>

The variable rx_process_result is being initialized with a value that is never read and is being re-assigned immediately afterwards. The assignment is redundant, so replace it with the return from function lan743x_rx_process_packet.

Addresses-Coverity: ("Unused value")

Applied to net-next, thanks.