* [PATCH] net/tipc: remove redundant variables 'tn' and 'oport'
@ 2018-07-31 16:01 Colin King
2018-08-01 6:10 ` Ying Xue
2018-08-01 16:48 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-07-31 16:01 UTC (permalink / raw)
To: Jon Maloy, Ying Xue, David S . Miller, netdev, tipc-discussion
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Variables 'tn' and 'oport' are being assigned but are never used hence
they are redundant and can be removed.
Cleans up clang warnings:
warning: variable 'oport' set but not used [-Wunused-but-set-variable]
warning: variable 'tn' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/tipc/socket.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3763bedecf5f..c1e93c9515bc 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -411,7 +411,6 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)
static int tipc_sk_create(struct net *net, struct socket *sock,
int protocol, int kern)
{
- struct tipc_net *tn;
const struct proto_ops *ops;
struct sock *sk;
struct tipc_sock *tsk;
@@ -446,7 +445,6 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
INIT_LIST_HEAD(&tsk->publications);
INIT_LIST_HEAD(&tsk->cong_links);
msg = &tsk->phdr;
- tn = net_generic(sock_net(sk), tipc_net_id);
/* Finish initializing socket data structures */
sock->ops = ops;
@@ -1117,7 +1115,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
u32 self = tipc_own_addr(net);
u32 type, lower, upper, scope;
struct sk_buff *skb, *_skb;
- u32 portid, oport, onode;
+ u32 portid, onode;
struct sk_buff_head tmpq;
struct list_head dports;
struct tipc_msg *hdr;
@@ -1133,7 +1131,6 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
user = msg_user(hdr);
mtyp = msg_type(hdr);
hlen = skb_headroom(skb) + msg_hdr_sz(hdr);
- oport = msg_origport(hdr);
onode = msg_orignode(hdr);
type = msg_nametype(hdr);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net/tipc: remove redundant variables 'tn' and 'oport'
2018-07-31 16:01 [PATCH] net/tipc: remove redundant variables 'tn' and 'oport' Colin King
@ 2018-08-01 6:10 ` Ying Xue
2018-08-01 16:48 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ying Xue @ 2018-08-01 6:10 UTC (permalink / raw)
To: Colin King, Jon Maloy, David S . Miller, netdev, tipc-discussion
Cc: kernel-janitors, linux-kernel
On 08/01/2018 12:01 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables 'tn' and 'oport' are being assigned but are never used hence
> they are redundant and can be removed.
>
> Cleans up clang warnings:
> warning: variable 'oport' set but not used [-Wunused-but-set-variable]
> warning: variable 'tn' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
> ---
> net/tipc/socket.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index 3763bedecf5f..c1e93c9515bc 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -411,7 +411,6 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)
> static int tipc_sk_create(struct net *net, struct socket *sock,
> int protocol, int kern)
> {
> - struct tipc_net *tn;
> const struct proto_ops *ops;
> struct sock *sk;
> struct tipc_sock *tsk;
> @@ -446,7 +445,6 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
> INIT_LIST_HEAD(&tsk->publications);
> INIT_LIST_HEAD(&tsk->cong_links);
> msg = &tsk->phdr;
> - tn = net_generic(sock_net(sk), tipc_net_id);
>
> /* Finish initializing socket data structures */
> sock->ops = ops;
> @@ -1117,7 +1115,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
> u32 self = tipc_own_addr(net);
> u32 type, lower, upper, scope;
> struct sk_buff *skb, *_skb;
> - u32 portid, oport, onode;
> + u32 portid, onode;
> struct sk_buff_head tmpq;
> struct list_head dports;
> struct tipc_msg *hdr;
> @@ -1133,7 +1131,6 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
> user = msg_user(hdr);
> mtyp = msg_type(hdr);
> hlen = skb_headroom(skb) + msg_hdr_sz(hdr);
> - oport = msg_origport(hdr);
> onode = msg_orignode(hdr);
> type = msg_nametype(hdr);
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/tipc: remove redundant variables 'tn' and 'oport'
2018-07-31 16:01 [PATCH] net/tipc: remove redundant variables 'tn' and 'oport' Colin King
2018-08-01 6:10 ` Ying Xue
@ 2018-08-01 16:48 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-01 16:48 UTC (permalink / raw)
To: colin.king
Cc: jon.maloy, ying.xue, netdev, tipc-discussion, kernel-janitors,
linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Tue, 31 Jul 2018 17:01:37 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables 'tn' and 'oport' are being assigned but are never used hence
> they are redundant and can be removed.
>
> Cleans up clang warnings:
> warning: variable 'oport' set but not used [-Wunused-but-set-variable]
> warning: variable 'tn' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-01 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 16:01 [PATCH] net/tipc: remove redundant variables 'tn' and 'oport' Colin King
2018-08-01 6:10 ` Ying Xue
2018-08-01 16:48 ` 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).