net: remove unnecessary return's
authorstephen hemminger <stephen@networkplumber.org>
Thu, 13 Feb 2014 04:51:22 +0000 (20:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 23:33:38 +0000 (18:33 -0500)
One of my pet coding style peeves is the practice of
adding extra return; at the end of function.
Kill several instances of this in network code.

I suppose some coccinelle wizardy could do this automatically.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/batman-adv/gateway_client.c
net/ceph/osd_client.c
net/core/request_sock.c
net/ipv4/route.c
net/ipv4/tcp_output.c
net/l2tp/l2tp_core.c
net/l2tp/l2tp_ppp.c
net/mac802154/mib.c
net/mac802154/rx.c
net/sctp/transport.c
net/wireless/chan.c

index 55cf2260d295b6f4002d438ed34b52382ed7eeea..d7fafc1009a08dc8d97a1b1f3449ffb661b21f82 100644 (file)
@@ -389,8 +389,6 @@ out:
                batadv_neigh_ifinfo_free_ref(router_gw_tq);
        if (router_orig_tq)
                batadv_neigh_ifinfo_free_ref(router_orig_tq);
-
-       return;
 }
 
 /**
index 0676f2b199d672eaf61157cdf78b75ee74afb434..82750f9158655225ad7dab9e903932d38f97b8a5 100644 (file)
@@ -2082,7 +2082,6 @@ bad:
        pr_err("osdc handle_map corrupt msg\n");
        ceph_msg_dump(msg);
        up_write(&osdc->map_sem);
-       return;
 }
 
 /*
@@ -2281,7 +2280,6 @@ done_err:
 
 bad:
        pr_err("osdc handle_watch_notify corrupt msg\n");
-       return;
 }
 
 /*
index 4425148d2b51592626b92a1451d9bc1208213fb8..467f326126e0eb913416c9bd2f847816d6d98948 100644 (file)
@@ -221,5 +221,4 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
 out:
        spin_unlock_bh(&fastopenq->lock);
        sock_put(lsk);
-       return;
 }
index 25071b48921cebc4788a1f4b0b5fa118832f5910..271554c61276910bc3f9765a51dbd072db9b198f 100644 (file)
@@ -697,7 +697,6 @@ static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw,
 
 out_unlock:
        spin_unlock_bh(&fnhe_lock);
-       return;
 }
 
 static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flowi4 *fl4,
index 3be16727f058b191d305366f9cf5851f03c7c417..48414fcca973641616a1caa472c9726f284b9799 100644 (file)
@@ -2071,7 +2071,6 @@ rearm_timer:
        if (likely(!err))
                NET_INC_STATS_BH(sock_net(sk),
                                 LINUX_MIB_TCPLOSSPROBES);
-       return;
 }
 
 /* Push out any pending frames which were held back due to
index 735d0f60c83a126683b599d1e967eb9ca18b0471..e5dc42f0e5279b7d4e19d4a5ab836e525fa24b3c 100644 (file)
@@ -1809,8 +1809,6 @@ void l2tp_session_free(struct l2tp_session *session)
        }
 
        kfree(session);
-
-       return;
 }
 EXPORT_SYMBOL_GPL(l2tp_session_free);
 
index be5fadf3473946a3b7ef886eeadcb2d219e867aa..ec40bc344be60208ef6eb2e5c0b6c650e383f496 100644 (file)
@@ -454,13 +454,11 @@ static void pppol2tp_session_close(struct l2tp_session *session)
 
        BUG_ON(session->magic != L2TP_SESSION_MAGIC);
 
-
        if (sock) {
                inet_shutdown(sock, 2);
                /* Don't let the session go away before our socket does */
                l2tp_session_inc_refcount(session);
        }
-       return;
 }
 
 /* Really kill the session socket. (Called from sock_put() if
@@ -474,7 +472,6 @@ static void pppol2tp_session_destruct(struct sock *sk)
                BUG_ON(session->magic != L2TP_SESSION_MAGIC);
                l2tp_session_dec_refcount(session);
        }
-       return;
 }
 
 /* Called when the PPPoX socket (session) is closed.
index 8ded97cf1c33f4336b3a59761095eff575ba6287..f48f40c1da1ae5870c008b48a64a9bbc4a9434d0 100644 (file)
@@ -62,8 +62,6 @@ static void hw_addr_notify(struct work_struct *work)
                pr_debug("failed changed mask %lx\n", nw->changed);
 
        kfree(nw);
-
-       return;
 }
 
 static void set_hw_addr_filt(struct net_device *dev, unsigned long changed)
@@ -79,8 +77,6 @@ static void set_hw_addr_filt(struct net_device *dev, unsigned long changed)
        work->dev = dev;
        work->changed = changed;
        queue_work(priv->hw->dev_workqueue, &work->work);
-
-       return;
 }
 
 void mac802154_dev_set_short_addr(struct net_device *dev, u16 val)
index 38548ec2098fb1350b4f4278a1a161f7495a2eb7..03855b0677ccf8efcb0819591bae63bd8609c693 100644 (file)
@@ -80,7 +80,6 @@ mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb, u8 lqi)
        mac802154_wpans_rx(priv, skb);
 out:
        dev_kfree_skb(skb);
-       return;
 }
 
 static void mac802154_rx_worker(struct work_struct *work)
index d0810dc5f079f67de9bf8192fa3968fd81e245f0..1d348d15b33de4c3b20f7f071442c05058e7dcc3 100644 (file)
@@ -652,5 +652,4 @@ void sctp_transport_immediate_rtx(struct sctp_transport *t)
                if (!mod_timer(&t->T3_rtx_timer, jiffies + t->rto))
                        sctp_transport_hold(t);
        }
-       return;
 }
index 78559b5bbd1fe1d98c533f18dd1cc4fce4087baa..a04b884f5d04634d3bcc9d61dea1066fd4d3d5bf 100644 (file)
@@ -701,6 +701,4 @@ cfg80211_get_chan_state(struct wireless_dev *wdev,
        case NUM_NL80211_IFTYPES:
                WARN_ON(1);
        }
-
-       return;
 }