netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tipc: remove set but not used variable 'prev'
@ 2020-05-28  7:43 YueHaibing
  2020-05-30  0:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-05-28  7:43 UTC (permalink / raw)
  To: Jon Maloy, Ying Xue, Jakub Kicinski, David S . Miller
  Cc: YueHaibing, netdev, tipc-discussion, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

net/tipc/msg.c: In function 'tipc_msg_append':
net/tipc/msg.c:215:24: warning:
 variable 'prev' set but not used [-Wunused-but-set-variable]

commit 0a3e060f340d ("tipc: add test for Nagle algorithm effectiveness")
left behind this, remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/tipc/msg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 23809039dda1..c0afcd627c5e 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -212,7 +212,7 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
 int tipc_msg_append(struct tipc_msg *_hdr, struct msghdr *m, int dlen,
 		    int mss, struct sk_buff_head *txq)
 {
-	struct sk_buff *skb, *prev;
+	struct sk_buff *skb;
 	int accounted, total, curr;
 	int mlen, cpy, rem = dlen;
 	struct tipc_msg *hdr;
@@ -223,7 +223,6 @@ int tipc_msg_append(struct tipc_msg *_hdr, struct msghdr *m, int dlen,
 
 	while (rem) {
 		if (!skb || skb->len >= mss) {
-			prev = skb;
 			skb = tipc_buf_acquire(mss, GFP_KERNEL);
 			if (unlikely(!skb))
 				return -ENOMEM;




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] tipc: remove set but not used variable 'prev'
  2020-05-28  7:43 [PATCH net-next] tipc: remove set but not used variable 'prev' YueHaibing
@ 2020-05-30  0:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-30  0:00 UTC (permalink / raw)
  To: yuehaibing
  Cc: jmaloy, ying.xue, kuba, netdev, tipc-discussion, kernel-janitors

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 28 May 2020 07:43:59 +0000

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> net/tipc/msg.c: In function 'tipc_msg_append':
> net/tipc/msg.c:215:24: warning:
>  variable 'prev' set but not used [-Wunused-but-set-variable]
> 
> commit 0a3e060f340d ("tipc: add test for Nagle algorithm effectiveness")
> left behind this, remove it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-30  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  7:43 [PATCH net-next] tipc: remove set but not used variable 'prev' YueHaibing
2020-05-30  0:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).