All of lore.kernel.org
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <dhowells@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-afs@lists.infradead.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next] rxrpc: remove redundant variables 'xcall','sp' and 'did_discard'
Date: Wed, 1 Aug 2018 15:32:51 +0800	[thread overview]
Message-ID: <20180801073251.9808-1-yuehaibing@huawei.com> (raw)

Variables 'xcall','sp' and 'did_discard' are being assigned,
but are never used,hence they are redundant and can be removed.

fix fllowing warning:

net/rxrpc/call_accept.c:110:22: warning: variable ‘xcall’ set but not used [-Wunused-but-set-variable]
net/rxrpc/call_event.c:165:25: warning: variable ‘sp’ set but not used [-Wunused-but-set-variable]
net/rxrpc/conn_client.c:1054:7: warning: variable ‘did_discard’ set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/rxrpc/call_accept.c | 2 --
 net/rxrpc/call_event.c  | 2 --
 net/rxrpc/conn_client.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
index a9a9be5..7487a62 100644
--- a/net/rxrpc/call_accept.c
+++ b/net/rxrpc/call_accept.c
@@ -107,7 +107,6 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
 
 	write_lock(&rx->call_lock);
 	if (user_attach_call) {
-		struct rxrpc_call *xcall;
 		struct rb_node *parent, **pp;
 
 		/* Check the user ID isn't already in use */
@@ -115,7 +114,6 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
 		parent = NULL;
 		while (*pp) {
 			parent = *pp;
-			xcall = rb_entry(parent, struct rxrpc_call, sock_node);
 			if (user_call_ID < call->user_call_ID)
 				pp = &(*pp)->rb_left;
 			else if (user_call_ID > call->user_call_ID)
diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index 2021041..8e7434e 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -162,7 +162,6 @@ static void rxrpc_congestion_timeout(struct rxrpc_call *call)
  */
 static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
 {
-	struct rxrpc_skb_priv *sp;
 	struct sk_buff *skb;
 	unsigned long resend_at;
 	rxrpc_seq_t cursor, seq, top;
@@ -207,7 +206,6 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
 
 		skb = call->rxtx_buffer[ix];
 		rxrpc_see_skb(skb, rxrpc_skb_tx_seen);
-		sp = rxrpc_skb(skb);
 
 		if (anno_type == RXRPC_TX_ANNO_UNACK) {
 			if (ktime_after(skb->tstamp, max_age)) {
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index 5736f64..e4bfbd7 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -1051,7 +1051,6 @@ void rxrpc_discard_expired_client_conns(struct work_struct *work)
 		container_of(work, struct rxrpc_net, client_conn_reaper);
 	unsigned long expiry, conn_expires_at, now;
 	unsigned int nr_conns;
-	bool did_discard = false;
 
 	_enter("");
 
@@ -1113,7 +1112,6 @@ void rxrpc_discard_expired_client_conns(struct work_struct *work)
 	 * If someone re-sets the flag and re-gets the ref, that's fine.
 	 */
 	rxrpc_put_connection(conn);
-	did_discard = true;
 	nr_conns--;
 	goto next;
 
-- 
2.7.0



             reply	other threads:[~2018-08-01  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01  7:32 YueHaibing [this message]
2018-08-01  8:28 ` [PATCH net-next] rxrpc: remove redundant variables 'xcall','sp' and 'did_discard' David Howells
2018-08-01  9:19   ` YueHaibing

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=20180801073251.9808-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.