Skip to content

Commit 2045cea

Browse files
shemmingerdavem330
authored andcommitted
net: remove unnecessary return's
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>
1 parent 45f7435 commit 2045cea

11 files changed

Lines changed: 0 additions & 20 deletions

File tree

‎net/batman-adv/gateway_client.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ void batadv_gw_check_election(struct batadv_priv *bat_priv,
389389
batadv_neigh_ifinfo_free_ref(router_gw_tq);
390390
if (router_orig_tq)
391391
batadv_neigh_ifinfo_free_ref(router_orig_tq);
392-
393-
return;
394392
}
395393

396394
/**

‎net/ceph/osd_client.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,6 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
20822082
pr_err("osdc handle_map corrupt msg\n");
20832083
ceph_msg_dump(msg);
20842084
up_write(&osdc->map_sem);
2085-
return;
20862085
}
20872086

20882087
/*
@@ -2281,7 +2280,6 @@ static void handle_watch_notify(struct ceph_osd_client *osdc,
22812280

22822281
bad:
22832282
pr_err("osdc handle_watch_notify corrupt msg\n");
2284-
return;
22852283
}
22862284

22872285
/*

‎net/core/request_sock.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,4 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
221221
out:
222222
spin_unlock_bh(&fastopenq->lock);
223223
sock_put(lsk);
224-
return;
225224
}

‎net/ipv4/route.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@ static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw,
697697

698698
out_unlock:
699699
spin_unlock_bh(&fnhe_lock);
700-
return;
701700
}
702701

703702
static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flowi4 *fl4,

‎net/ipv4/tcp_output.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,6 @@ void tcp_send_loss_probe(struct sock *sk)
20712071
if (likely(!err))
20722072
NET_INC_STATS_BH(sock_net(sk),
20732073
LINUX_MIB_TCPLOSSPROBES);
2074-
return;
20752074
}
20762075

20772076
/* Push out any pending frames which were held back due to

‎net/l2tp/l2tp_core.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,8 +1809,6 @@ void l2tp_session_free(struct l2tp_session *session)
18091809
}
18101810

18111811
kfree(session);
1812-
1813-
return;
18141812
}
18151813
EXPORT_SYMBOL_GPL(l2tp_session_free);
18161814

‎net/l2tp/l2tp_ppp.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,11 @@ static void pppol2tp_session_close(struct l2tp_session *session)
454454

455455
BUG_ON(session->magic != L2TP_SESSION_MAGIC);
456456

457-
458457
if (sock) {
459458
inet_shutdown(sock, 2);
460459
/* Don't let the session go away before our socket does */
461460
l2tp_session_inc_refcount(session);
462461
}
463-
return;
464462
}
465463

466464
/* Really kill the session socket. (Called from sock_put() if
@@ -474,7 +472,6 @@ static void pppol2tp_session_destruct(struct sock *sk)
474472
BUG_ON(session->magic != L2TP_SESSION_MAGIC);
475473
l2tp_session_dec_refcount(session);
476474
}
477-
return;
478475
}
479476

480477
/* Called when the PPPoX socket (session) is closed.

‎net/mac802154/mib.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ static void hw_addr_notify(struct work_struct *work)
6262
pr_debug("failed changed mask %lx\n", nw->changed);
6363

6464
kfree(nw);
65-
66-
return;
6765
}
6866

6967
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)
7977
work->dev = dev;
8078
work->changed = changed;
8179
queue_work(priv->hw->dev_workqueue, &work->work);
82-
83-
return;
8480
}
8581

8682
void mac802154_dev_set_short_addr(struct net_device *dev, u16 val)

‎net/mac802154/rx.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb, u8 lqi)
8080
mac802154_wpans_rx(priv, skb);
8181
out:
8282
dev_kfree_skb(skb);
83-
return;
8483
}
8584

8685
static void mac802154_rx_worker(struct work_struct *work)

‎net/sctp/transport.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,5 +652,4 @@ void sctp_transport_immediate_rtx(struct sctp_transport *t)
652652
if (!mod_timer(&t->T3_rtx_timer, jiffies + t->rto))
653653
sctp_transport_hold(t);
654654
}
655-
return;
656655
}

0 commit comments

Comments
 (0)