Skip to content

Commit 3fa21e0

Browse files
JoePerchesdavem330
authored andcommitted
net: Remove unnecessary returns from void function()s
This patch removes from net/ (but not any netfilter files) all the unnecessary return; statements that precede the last closing brace of void functions. It does not remove the returns that are immediately preceded by a label as gcc doesn't like that. Done via: $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \ xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }' Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b60b659 commit 3fa21e0

48 files changed

Lines changed: 0 additions & 131 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎net/9p/trans_rdma.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ handle_recv(struct p9_client *client, struct p9_trans_rdma *rdma,
308308
req, err, status);
309309
rdma->state = P9_RDMA_FLUSHING;
310310
client->status = Disconnected;
311-
return;
312311
}
313312

314313
static void

‎net/atm/br2684.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
446446
net_dev->stats.rx_errors++;
447447
free_skb:
448448
dev_kfree_skb(skb);
449-
return;
450449
}
451450

452451
/*

‎net/atm/lec.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
161161
skb_queue_tail(&sk->sk_receive_queue, skb2);
162162
sk->sk_data_ready(sk, skb2->len);
163163
}
164-
165-
return;
166164
}
167165
#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
168166

@@ -640,7 +638,6 @@ static void lec_set_multicast_list(struct net_device *dev)
640638
* by default, all multicast frames arrive over the bus.
641639
* eventually support selective multicast service
642640
*/
643-
return;
644641
}
645642

646643
static const struct net_device_ops lec_netdev_ops = {
@@ -1199,8 +1196,6 @@ static void __exit lane_module_cleanup(void)
11991196
dev_lec[i] = NULL;
12001197
}
12011198
}
1202-
1203-
return;
12041199
}
12051200

12061201
module_init(lane_module_init);
@@ -1334,7 +1329,6 @@ static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr,
13341329
priv->lane2_ops->associate_indicator(dev, mac_addr,
13351330
tlvs, sizeoftlvs);
13361331
}
1337-
return;
13381332
}
13391333

13401334
/*

‎net/atm/mpc.c‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr,
455455
if (end_of_tlvs - tlvs != 0)
456456
pr_info("(%s) ignoring %Zd bytes of trailing TLV garbage\n",
457457
dev->name, end_of_tlvs - tlvs);
458-
return;
459458
}
460459

461460
/*
@@ -684,8 +683,6 @@ static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
684683

685684
if (in_entry == NULL && eg_entry == NULL)
686685
dprintk("(%s) unused vcc closed\n", dev->name);
687-
688-
return;
689686
}
690687

691688
static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
@@ -783,8 +780,6 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
783780

784781
memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
785782
netif_rx(new_skb);
786-
787-
return;
788783
}
789784

790785
static struct atmdev_ops mpc_ops = { /* only send is required */
@@ -873,8 +868,6 @@ static void send_set_mps_ctrl_addr(const char *addr, struct mpoa_client *mpc)
873868
mesg.type = SET_MPS_CTRL_ADDR;
874869
memcpy(mesg.MPS_ctrl, addr, ATM_ESA_LEN);
875870
msg_to_mpoad(&mesg, mpc);
876-
877-
return;
878871
}
879872

880873
static void mpoad_close(struct atm_vcc *vcc)
@@ -911,8 +904,6 @@ static void mpoad_close(struct atm_vcc *vcc)
911904
pr_info("(%s) going down\n",
912905
(mpc->dev) ? mpc->dev->name : "<unknown>");
913906
module_put(THIS_MODULE);
914-
915-
return;
916907
}
917908

918909
/*
@@ -1122,7 +1113,6 @@ static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
11221113
pr_info("(%s) entry already in resolving state\n",
11231114
(mpc->dev) ? mpc->dev->name : "<unknown>");
11241115
mpc->in_ops->put(entry);
1125-
return;
11261116
}
11271117

11281118
/*
@@ -1166,7 +1156,6 @@ static void check_qos_and_open_shortcut(struct k_message *msg,
11661156
} else
11671157
memset(&msg->qos, 0, sizeof(struct atm_qos));
11681158
msg_to_mpoad(msg, client);
1169-
return;
11701159
}
11711160

11721161
static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
@@ -1240,8 +1229,6 @@ static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
12401229
mpc->in_ops->put(entry);
12411230
entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);
12421231
} while (entry != NULL);
1243-
1244-
return;
12451232
}
12461233

12471234
static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
@@ -1260,8 +1247,6 @@ static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
12601247
write_unlock_irq(&mpc->egress_lock);
12611248

12621249
mpc->eg_ops->put(entry);
1263-
1264-
return;
12651250
}
12661251

12671252
static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
@@ -1295,8 +1280,6 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
12951280
skb_queue_tail(&sk->sk_receive_queue, skb);
12961281
sk->sk_data_ready(sk, skb->len);
12971282
dprintk("exiting\n");
1298-
1299-
return;
13001283
}
13011284

13021285
/*
@@ -1325,8 +1308,6 @@ static void mps_death(struct k_message *msg, struct mpoa_client *mpc)
13251308

13261309
mpc->in_ops->destroy_cache(mpc);
13271310
mpc->eg_ops->destroy_cache(mpc);
1328-
1329-
return;
13301311
}
13311312

13321313
static void MPOA_cache_impos_rcvd(struct k_message *msg,
@@ -1353,8 +1334,6 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg,
13531334
write_unlock_irq(&mpc->egress_lock);
13541335

13551336
mpc->eg_ops->put(entry);
1356-
1357-
return;
13581337
}
13591338

13601339
static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg,
@@ -1392,8 +1371,6 @@ static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg,
13921371
pr_info("(%s) targetless LE_ARP request failed\n",
13931372
mpc->dev->name);
13941373
}
1395-
1396-
return;
13971374
}
13981375

13991376
static void set_mps_mac_addr_rcvd(struct k_message *msg,
@@ -1409,8 +1386,6 @@ static void set_mps_mac_addr_rcvd(struct k_message *msg,
14091386
return;
14101387
}
14111388
client->number_of_mps_macs = 1;
1412-
1413-
return;
14141389
}
14151390

14161391
/*
@@ -1436,7 +1411,6 @@ static void clean_up(struct k_message *msg, struct mpoa_client *mpc, int action)
14361411

14371412
msg->type = action;
14381413
msg_to_mpoad(msg, mpc);
1439-
return;
14401414
}
14411415

14421416
static void mpc_timer_refresh(void)
@@ -1445,8 +1419,6 @@ static void mpc_timer_refresh(void)
14451419
mpc_timer.data = mpc_timer.expires;
14461420
mpc_timer.function = mpc_cache_check;
14471421
add_timer(&mpc_timer);
1448-
1449-
return;
14501422
}
14511423

14521424
static void mpc_cache_check(unsigned long checking_time)
@@ -1471,8 +1443,6 @@ static void mpc_cache_check(unsigned long checking_time)
14711443
mpc = mpc->next;
14721444
}
14731445
mpc_timer_refresh();
1474-
1475-
return;
14761446
}
14771447

14781448
static int atm_mpoa_ioctl(struct socket *sock, unsigned int cmd,
@@ -1561,8 +1531,6 @@ static void __exit atm_mpoa_cleanup(void)
15611531
kfree(qos);
15621532
qos = nextqos;
15631533
}
1564-
1565-
return;
15661534
}
15671535

15681536
module_init(atm_mpoa_init);

‎net/atm/mpoa_caches.c‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ static void in_cache_put(in_cache_entry *entry)
182182
memset(entry, 0, sizeof(in_cache_entry));
183183
kfree(entry);
184184
}
185-
186-
return;
187185
}
188186

189187
/*
@@ -221,8 +219,6 @@ static void in_cache_remove_entry(in_cache_entry *entry,
221219
}
222220
vcc_release_async(vcc, -EPIPE);
223221
}
224-
225-
return;
226222
}
227223

228224
/* Call this every MPC-p2 seconds... Not exactly correct solution,
@@ -248,8 +244,6 @@ static void clear_count_and_expired(struct mpoa_client *client)
248244
entry = next_entry;
249245
}
250246
write_unlock_bh(&client->ingress_lock);
251-
252-
return;
253247
}
254248

255249
/* Call this every MPC-p4 seconds. */
@@ -334,8 +328,6 @@ static void in_destroy_cache(struct mpoa_client *mpc)
334328
while (mpc->in_cache != NULL)
335329
mpc->in_ops->remove_entry(mpc->in_cache, mpc);
336330
write_unlock_irq(&mpc->ingress_lock);
337-
338-
return;
339331
}
340332

341333
static eg_cache_entry *eg_cache_get_by_cache_id(__be32 cache_id,
@@ -427,8 +419,6 @@ static void eg_cache_put(eg_cache_entry *entry)
427419
memset(entry, 0, sizeof(eg_cache_entry));
428420
kfree(entry);
429421
}
430-
431-
return;
432422
}
433423

434424
/*
@@ -463,8 +453,6 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
463453
}
464454
vcc_release_async(vcc, -EPIPE);
465455
}
466-
467-
return;
468456
}
469457

470458
static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
@@ -509,8 +497,6 @@ static void update_eg_cache_entry(eg_cache_entry *entry, uint16_t holding_time)
509497
do_gettimeofday(&(entry->tv));
510498
entry->entry_state = EGRESS_RESOLVED;
511499
entry->ctrl_info.holding_time = holding_time;
512-
513-
return;
514500
}
515501

516502
static void clear_expired(struct mpoa_client *client)
@@ -537,8 +523,6 @@ static void clear_expired(struct mpoa_client *client)
537523
entry = next_entry;
538524
}
539525
write_unlock_irq(&client->egress_lock);
540-
541-
return;
542526
}
543527

544528
static void eg_destroy_cache(struct mpoa_client *mpc)
@@ -547,8 +531,6 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
547531
while (mpc->eg_cache != NULL)
548532
mpc->eg_ops->remove_entry(mpc->eg_cache, mpc);
549533
write_unlock_irq(&mpc->egress_lock);
550-
551-
return;
552534
}
553535

554536

@@ -584,6 +566,4 @@ void atm_mpoa_init_cache(struct mpoa_client *mpc)
584566
{
585567
mpc->in_ops = &ingress_ops;
586568
mpc->eg_ops = &egress_ops;
587-
588-
return;
589569
}

‎net/bluetooth/hci_core.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,6 @@ void hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
13161316
}
13171317

13181318
tasklet_schedule(&hdev->tx_task);
1319-
1320-
return;
13211319
}
13221320
EXPORT_SYMBOL(hci_send_acl);
13231321

‎net/bluetooth/l2cap.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,6 @@ static void l2cap_drop_acked_frames(struct sock *sk)
13221322

13231323
if (!l2cap_pi(sk)->unacked_frames)
13241324
del_timer(&l2cap_pi(sk)->retrans_timer);
1325-
1326-
return;
13271325
}
13281326

13291327
static inline void l2cap_do_send(struct sock *sk, struct sk_buff *skb)
@@ -4667,7 +4665,6 @@ void l2cap_load(void)
46674665
/* Dummy function to trigger automatic L2CAP module loading by
46684666
* other modules that use L2CAP sockets but don't use any other
46694667
* symbols from it. */
4670-
return;
46714668
}
46724669
EXPORT_SYMBOL(l2cap_load);
46734670

‎net/bluetooth/rfcomm/tty.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,6 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
10141014
rfcomm_send_rpn(dev->dlc->session, 1, dev->dlc->dlci, baud,
10151015
data_bits, stop_bits, parity,
10161016
RFCOMM_RPN_FLOW_NONE, x_on, x_off, changes);
1017-
1018-
return;
10191017
}
10201018

10211019
static void rfcomm_tty_throttle(struct tty_struct *tty)

‎net/bluetooth/sco.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ static inline void sco_recv_frame(struct sco_conn *conn, struct sk_buff *skb)
273273

274274
drop:
275275
kfree_skb(skb);
276-
return;
277276
}
278277

279278
/* -------- Socket interface ---------- */

‎net/caif/caif_dev.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ static void caif_device_destroy(struct net_device *dev)
112112
spin_unlock_bh(&caifdevs->lock);
113113

114114
kfree(caifd);
115-
return;
116115
}
117116

118117
static int transmit(struct cflayer *layer, struct cfpkt *pkt)

0 commit comments

Comments
 (0)