Skip to content

Commit a02cec2

Browse files
Eric Dumazetdavem330
authored andcommitted
net: return operator cleanup
Change "return (EXPR);" to "return EXPR;" return is not a function, parentheses are not required. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6a08d19 commit a02cec2

Some content is hidden

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

84 files changed

+220
-222
lines changed

include/linux/atmdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void vcc_insert_socket(struct sock *sk);
449449

450450
static inline int atm_guess_pdu2truesize(int size)
451451
{
452-
return (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info));
452+
return SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info);
453453
}
454454

455455

include/linux/etherdevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
7171
*/
7272
static inline int is_multicast_ether_addr(const u8 *addr)
7373
{
74-
return (0x01 & addr[0]);
74+
return 0x01 & addr[0];
7575
}
7676

7777
/**
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
8282
*/
8383
static inline int is_local_ether_addr(const u8 *addr)
8484
{
85-
return (0x02 & addr[0]);
85+
return 0x02 & addr[0];
8686
}
8787

8888
/**

include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
16761676
*/
16771677
static inline int netif_is_multiqueue(const struct net_device *dev)
16781678
{
1679-
return (dev->num_tx_queues > 1);
1679+
return dev->num_tx_queues > 1;
16801680
}
16811681

16821682
extern void netif_set_real_num_tx_queues(struct net_device *dev,

include/linux/skbuff.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
601601
static inline bool skb_queue_is_last(const struct sk_buff_head *list,
602602
const struct sk_buff *skb)
603603
{
604-
return (skb->next == (struct sk_buff *) list);
604+
return skb->next == (struct sk_buff *)list;
605605
}
606606

607607
/**
@@ -614,7 +614,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
614614
static inline bool skb_queue_is_first(const struct sk_buff_head *list,
615615
const struct sk_buff *skb)
616616
{
617-
return (skb->prev == (struct sk_buff *) list);
617+
return skb->prev == (struct sk_buff *)list;
618618
}
619619

620620
/**
@@ -2156,7 +2156,7 @@ static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
21562156

21572157
static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
21582158
{
2159-
return (skb->queue_mapping != 0);
2159+
return skb->queue_mapping != 0;
21602160
}
21612161

21622162
extern u16 skb_tx_hash(const struct net_device *dev,

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static inline void inquiry_cache_init(struct hci_dev *hdev)
233233
static inline int inquiry_cache_empty(struct hci_dev *hdev)
234234
{
235235
struct inquiry_cache *c = &hdev->inq_cache;
236-
return (c->list == NULL);
236+
return c->list == NULL;
237237
}
238238

239239
static inline long inquiry_cache_age(struct hci_dev *hdev)

include/net/bluetooth/l2cap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static inline int l2cap_tx_window_full(struct sock *sk)
414414
if (sub < 0)
415415
sub += 64;
416416

417-
return (sub == pi->remote_tx_win);
417+
return sub == pi->remote_tx_win;
418418
}
419419

420420
#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1

include/net/inet_ecn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline int INET_ECN_is_not_ect(__u8 dsfield)
2727

2828
static inline int INET_ECN_is_capable(__u8 dsfield)
2929
{
30-
return (dsfield & INET_ECN_ECT_0);
30+
return dsfield & INET_ECN_ECT_0;
3131
}
3232

3333
static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)

include/net/ip.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ int ip_decrease_ttl(struct iphdr *iph)
238238
static inline
239239
int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
240240
{
241-
return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
241+
return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
242242
(inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
243-
!(dst_metric_locked(dst, RTAX_MTU))));
243+
!(dst_metric_locked(dst, RTAX_MTU)));
244244
}
245245

246246
extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);

include/net/ipv6.h

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static inline int ipv6_addr_scope(const struct in6_addr *addr)
262262

263263
static inline int __ipv6_addr_src_scope(int type)
264264
{
265-
return (type == IPV6_ADDR_ANY ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16));
265+
return (type == IPV6_ADDR_ANY) ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16);
266266
}
267267

268268
static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
@@ -279,10 +279,10 @@ static inline int
279279
ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
280280
const struct in6_addr *a2)
281281
{
282-
return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) |
283-
((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) |
284-
((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) |
285-
((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])));
282+
return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) |
283+
((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) |
284+
((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) |
285+
((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]));
286286
}
287287

288288
static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
@@ -317,10 +317,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
317317
static inline int ipv6_addr_equal(const struct in6_addr *a1,
318318
const struct in6_addr *a2)
319319
{
320-
return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
321-
(a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
322-
(a1->s6_addr32[2] ^ a2->s6_addr32[2]) |
323-
(a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0);
320+
return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
321+
(a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
322+
(a1->s6_addr32[2] ^ a2->s6_addr32[2]) |
323+
(a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0;
324324
}
325325

326326
static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
@@ -373,20 +373,20 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a);
373373

374374
static inline int ipv6_addr_any(const struct in6_addr *a)
375375
{
376-
return ((a->s6_addr32[0] | a->s6_addr32[1] |
377-
a->s6_addr32[2] | a->s6_addr32[3] ) == 0);
376+
return (a->s6_addr32[0] | a->s6_addr32[1] |
377+
a->s6_addr32[2] | a->s6_addr32[3]) == 0;
378378
}
379379

380380
static inline int ipv6_addr_loopback(const struct in6_addr *a)
381381
{
382-
return ((a->s6_addr32[0] | a->s6_addr32[1] |
383-
a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0);
382+
return (a->s6_addr32[0] | a->s6_addr32[1] |
383+
a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0;
384384
}
385385

386386
static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
387387
{
388-
return ((a->s6_addr32[0] | a->s6_addr32[1] |
389-
(a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0);
388+
return (a->s6_addr32[0] | a->s6_addr32[1] |
389+
(a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0;
390390
}
391391

392392
/*
@@ -395,8 +395,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
395395
*/
396396
static inline int ipv6_addr_orchid(const struct in6_addr *a)
397397
{
398-
return ((a->s6_addr32[0] & htonl(0xfffffff0))
399-
== htonl(0x20010010));
398+
return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
400399
}
401400

402401
static inline void ipv6_addr_set_v4mapped(const __be32 addr,
@@ -441,7 +440,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
441440
* if returned value is greater than prefix length.
442441
* --ANK (980803)
443442
*/
444-
return (addrlen << 5);
443+
return addrlen << 5;
445444
}
446445

447446
static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2)

include/net/irda/irlap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static inline int irlap_is_primary(struct irlap_cb *self)
282282
default:
283283
ret = -1;
284284
}
285-
return(ret);
285+
return ret;
286286
}
287287

288288
/* Clear a pending IrLAP disconnect. - Jean II */

0 commit comments

Comments
 (0)