Commit bfafb26e authored by Florian Zumbiehl's avatar Florian Zumbiehl Committed by David S. Miller

[PPPoE]: miscellaneous smaller cleanups

below is a patch that just removes dead code/initializers without any
effect (first access is an assignment) that I stumbled accross while
reading the source.
Signed-off-by: default avatarFlorian Zumbiehl <florz@florz.de>
Acked-by: default avatarMichal Ostrowski <mostrows@earthlink.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c6fcc8a
...@@ -207,7 +207,7 @@ static inline struct pppox_sock *get_item(unsigned long sid, ...@@ -207,7 +207,7 @@ static inline struct pppox_sock *get_item(unsigned long sid,
static inline struct pppox_sock *get_item_by_addr(struct sockaddr_pppox *sp) static inline struct pppox_sock *get_item_by_addr(struct sockaddr_pppox *sp)
{ {
struct net_device *dev = NULL; struct net_device *dev;
int ifindex; int ifindex;
dev = dev_get_by_name(sp->sa_addr.pppoe.dev); dev = dev_get_by_name(sp->sa_addr.pppoe.dev);
...@@ -222,9 +222,6 @@ static inline int set_item(struct pppox_sock *po) ...@@ -222,9 +222,6 @@ static inline int set_item(struct pppox_sock *po)
{ {
int i; int i;
if (!po)
return -EINVAL;
write_lock_bh(&pppoe_hash_lock); write_lock_bh(&pppoe_hash_lock);
i = __set_item(po); i = __set_item(po);
write_unlock_bh(&pppoe_hash_lock); write_unlock_bh(&pppoe_hash_lock);
...@@ -344,7 +341,7 @@ static struct notifier_block pppoe_notifier = { ...@@ -344,7 +341,7 @@ static struct notifier_block pppoe_notifier = {
static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
{ {
struct pppox_sock *po = pppox_sk(sk); struct pppox_sock *po = pppox_sk(sk);
struct pppox_sock *relay_po = NULL; struct pppox_sock *relay_po;
if (sk->sk_state & PPPOX_BOUND) { if (sk->sk_state & PPPOX_BOUND) {
struct pppoe_hdr *ph = pppoe_hdr(skb); struct pppoe_hdr *ph = pppoe_hdr(skb);
...@@ -514,7 +511,6 @@ static int pppoe_release(struct socket *sock) ...@@ -514,7 +511,6 @@ static int pppoe_release(struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct pppox_sock *po; struct pppox_sock *po;
int error = 0;
if (!sk) if (!sk)
return 0; return 0;
...@@ -543,7 +539,7 @@ static int pppoe_release(struct socket *sock) ...@@ -543,7 +539,7 @@ static int pppoe_release(struct socket *sock)
skb_queue_purge(&sk->sk_receive_queue); skb_queue_purge(&sk->sk_receive_queue);
sock_put(sk); sock_put(sk);
return error; return 0;
} }
...@@ -762,10 +758,10 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, ...@@ -762,10 +758,10 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len) struct msghdr *m, size_t total_len)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb;
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct pppox_sock *po = pppox_sk(sk); struct pppox_sock *po = pppox_sk(sk);
int error = 0; int error;
struct pppoe_hdr hdr; struct pppoe_hdr hdr;
struct pppoe_hdr *ph; struct pppoe_hdr *ph;
struct net_device *dev; struct net_device *dev;
...@@ -930,7 +926,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -930,7 +926,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len, int flags) struct msghdr *m, size_t total_len, int flags)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct sk_buff *skb = NULL; struct sk_buff *skb;
int error = 0; int error = 0;
if (sk->sk_state & PPPOX_BOUND) { if (sk->sk_state & PPPOX_BOUND) {
...@@ -941,9 +937,8 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -941,9 +937,8 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &error); flags & MSG_DONTWAIT, &error);
if (error < 0) { if (error < 0)
goto end; goto end;
}
m->msg_namelen = 0; m->msg_namelen = 0;
...@@ -986,7 +981,7 @@ static int pppoe_seq_show(struct seq_file *seq, void *v) ...@@ -986,7 +981,7 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
static __inline__ struct pppox_sock *pppoe_get_idx(loff_t pos) static __inline__ struct pppox_sock *pppoe_get_idx(loff_t pos)
{ {
struct pppox_sock *po = NULL; struct pppox_sock *po;
int i = 0; int i = 0;
for (; i < PPPOE_HASH_SIZE; i++) { for (; i < PPPOE_HASH_SIZE; i++) {
......
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