Commit e57c624b authored by Hannes Eder's avatar Hannes Eder Committed by David S. Miller

decnet: fix sparse warnings: symbol shadows an earlier one

Impact: Remove redundant variable declarations, resp. rename
inner scope variable.

Fix this sparse warnings:
  net/decnet/af_decnet.c:1252:40: warning: symbol 'skb' shadows an earlier one
  net/decnet/af_decnet.c:1223:24: originally declared here
  net/decnet/af_decnet.c:1582:29: warning: symbol 'val' shadows an earlier one
  net/decnet/af_decnet.c:1527:22: originally declared here
  net/decnet/dn_dev.c:687:21: warning: symbol 'err' shadows an earlier one
  net/decnet/dn_dev.c:670:13: originally declared here
  net/decnet/sysctl_net_decnet.c:182:21: warning: symbol 'len' shadows an earlier one
  net/decnet/sysctl_net_decnet.c:173:16: originally declared here
Signed-off-by: default avatarHannes Eder <hannes@hanneseder.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8521c27e
...@@ -1246,11 +1246,12 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1246,11 +1246,12 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case TIOCINQ: case TIOCINQ:
lock_sock(sk); lock_sock(sk);
if ((skb = skb_peek(&scp->other_receive_queue)) != NULL) { skb = skb_peek(&scp->other_receive_queue);
if (skb) {
amount = skb->len; amount = skb->len;
} else { } else {
struct sk_buff *skb = sk->sk_receive_queue.next; skb = sk->sk_receive_queue.next;
for(;;) { for (;;) {
if (skb == if (skb ==
(struct sk_buff *)&sk->sk_receive_queue) (struct sk_buff *)&sk->sk_receive_queue)
break; break;
...@@ -1579,16 +1580,16 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us ...@@ -1579,16 +1580,16 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
default: default:
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
{ {
int val, len; int ret, len;
if(get_user(len, optlen)) if(get_user(len, optlen))
return -EFAULT; return -EFAULT;
val = nf_getsockopt(sk, PF_DECnet, optname, ret = nf_getsockopt(sk, PF_DECnet, optname,
optval, &len); optval, &len);
if (val >= 0) if (ret >= 0)
val = put_user(len, optlen); ret = put_user(len, optlen);
return val; return ret;
} }
#endif #endif
case DSO_STREAM: case DSO_STREAM:
......
...@@ -684,7 +684,6 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) ...@@ -684,7 +684,6 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
return -ENODEV; return -ENODEV;
if ((dn_db = dev->dn_ptr) == NULL) { if ((dn_db = dev->dn_ptr) == NULL) {
int err;
dn_db = dn_dev_create(dev, &err); dn_db = dn_dev_create(dev, &err);
if (!dn_db) if (!dn_db)
return err; return err;
......
...@@ -179,7 +179,7 @@ static int dn_node_address_handler(ctl_table *table, int write, ...@@ -179,7 +179,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
} }
if (write) { if (write) {
int len = (*lenp < DN_ASCBUF_LEN) ? *lenp : (DN_ASCBUF_LEN-1); len = (*lenp < DN_ASCBUF_LEN) ? *lenp : (DN_ASCBUF_LEN-1);
if (copy_from_user(addr, buffer, len)) if (copy_from_user(addr, buffer, len))
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment