Skip to contentSkip to conversation

net/rxrpc/ar-output.c: remove dead code

RFC PATCH In review Adrian Bunk 3 participants 3 messages Jun 15, 2007 – Jun 18, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net/rxrpc/ar-output.c: remove dead code

This patch removes dead code spotted by the Coverity checker.

---

 net/rxrpc/ar-output.c |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
net/rxrpc/ar-output.c renamed from net/rxrpc/ar-output.c.old +4 -10
@@ -530,7 +530,7 @@ static int rxrpc_send_data(struct kiocb 
 	struct sock *sk = &rx->sk;
 	long timeo;
 	bool more;
-	int ret, ioc, segment, copied;
+	int ret, ioc, segment;
 
 	_enter(",,,{%zu},%zu", msg->msg_iovlen, len);
 
@@ -552,7 +552,6 @@ static int rxrpc_send_data(struct kiocb 
 	skb = call->tx_pending;
 	call->tx_pending = NULL;
 
-	copied = 0;
 	do {
 		int copy;
 
@@ -570,11 +569,11 @@ static int rxrpc_send_data(struct kiocb 
 				       call->acks_winsz) <= 0) {
 				ret = -EAGAIN;
 				if (msg->msg_flags & MSG_DONTWAIT)
-					goto maybe_error;
+					goto out;
 				ret = rxrpc_wait_for_tx_window(rx, call,
 							       &timeo);
 				if (ret < 0)
-					goto maybe_error;
+					goto out;
 			}
 
 			max = call->conn->trans->peer->maxdata;
@@ -596,7 +595,7 @@ static int rxrpc_send_data(struct kiocb 
 			skb = sock_alloc_send_skb(
 				sk, size, msg->msg_flags & MSG_DONTWAIT, &ret);
 			if (!skb)
-				goto maybe_error;
+				goto out;
 
 			rxrpc_new_skb(skb);
 
@@ -723,11 +722,6 @@ call_aborted:
 	_leave(" = %d", ret);
 	return ret;
 
-maybe_error:
-	if (copied)
-		ret = copied;
-	goto out;
-
 efault:
 	ret = -EFAULT;
 	goto out;
maintainer
#2 lore raw
In reply to Adrian Bunk
Quoted 1 line · Adrian Bunk

This patch removes dead code spotted by the Coverity checker.

This is the wrong solution. 'copied' should be updated.

David