diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
tree | 32e280957474f458901abfce16fa2a1687ef7497 /include/net/sctp | |
parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'include/net/sctp')
-rw-r--r-- | include/net/sctp/sctp.h | 60 | ||||
-rw-r--r-- | include/net/sctp/sm.h | 10 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 2 | ||||
-rw-r--r-- | include/net/sctp/tsnmap.h | 2 |
4 files changed, 43 insertions, 31 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 65946bc43d00..505845ddb0be 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -275,24 +275,35 @@ struct sctp_mib { | |||
275 | /* Print debugging messages. */ | 275 | /* Print debugging messages. */ |
276 | #if SCTP_DEBUG | 276 | #if SCTP_DEBUG |
277 | extern int sctp_debug_flag; | 277 | extern int sctp_debug_flag; |
278 | #define SCTP_DEBUG_PRINTK(whatever...) \ | 278 | #define SCTP_DEBUG_PRINTK(fmt, args...) \ |
279 | ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) | 279 | do { \ |
280 | #define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ | 280 | if (sctp_debug_flag) \ |
281 | if (sctp_debug_flag) { \ | 281 | printk(KERN_DEBUG pr_fmt(fmt), ##args); \ |
282 | if (saddr->sa.sa_family == AF_INET6) { \ | 282 | } while (0) |
283 | printk(KERN_DEBUG \ | 283 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \ |
284 | lead "%pI6" trail, \ | 284 | do { \ |
285 | leadparm, \ | 285 | if (sctp_debug_flag) \ |
286 | &saddr->v6.sin6_addr, \ | 286 | pr_cont(fmt, ##args); \ |
287 | otherparms); \ | 287 | } while (0) |
288 | } else { \ | 288 | #define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ |
289 | printk(KERN_DEBUG \ | 289 | args_lead, saddr, args_trail...) \ |
290 | lead "%pI4" trail, \ | 290 | do { \ |
291 | leadparm, \ | 291 | if (sctp_debug_flag) { \ |
292 | &saddr->v4.sin_addr.s_addr, \ | 292 | if (saddr->sa.sa_family == AF_INET6) { \ |
293 | otherparms); \ | 293 | printk(KERN_DEBUG \ |
294 | } \ | 294 | pr_fmt(fmt_lead "%pI6" fmt_trail), \ |
295 | } | 295 | args_lead, \ |
296 | &saddr->v6.sin6_addr, \ | ||
297 | args_trail); \ | ||
298 | } else { \ | ||
299 | printk(KERN_DEBUG \ | ||
300 | pr_fmt(fmt_lead "%pI4" fmt_trail), \ | ||
301 | args_lead, \ | ||
302 | &saddr->v4.sin_addr.s_addr, \ | ||
303 | args_trail); \ | ||
304 | } \ | ||
305 | } \ | ||
306 | } while (0) | ||
296 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } | 307 | #define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } |
297 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } | 308 | #define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } |
298 | 309 | ||
@@ -306,6 +317,7 @@ extern int sctp_debug_flag; | |||
306 | #else /* SCTP_DEBUG */ | 317 | #else /* SCTP_DEBUG */ |
307 | 318 | ||
308 | #define SCTP_DEBUG_PRINTK(whatever...) | 319 | #define SCTP_DEBUG_PRINTK(whatever...) |
320 | #define SCTP_DEBUG_PRINTK_CONT(fmt, args...) | ||
309 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) | 321 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) |
310 | #define SCTP_ENABLE_DEBUG | 322 | #define SCTP_ENABLE_DEBUG |
311 | #define SCTP_DISABLE_DEBUG | 323 | #define SCTP_DISABLE_DEBUG |
@@ -393,7 +405,7 @@ static inline void sctp_v6_del_protocol(void) { return; } | |||
393 | /* Map an association to an assoc_id. */ | 405 | /* Map an association to an assoc_id. */ |
394 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) | 406 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) |
395 | { | 407 | { |
396 | return (asoc?asoc->assoc_id:0); | 408 | return asoc ? asoc->assoc_id : 0; |
397 | } | 409 | } |
398 | 410 | ||
399 | /* Look up the association by its id. */ | 411 | /* Look up the association by its id. */ |
@@ -461,7 +473,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
461 | /* Tests if the list has one and only one entry. */ | 473 | /* Tests if the list has one and only one entry. */ |
462 | static inline int sctp_list_single_entry(struct list_head *head) | 474 | static inline int sctp_list_single_entry(struct list_head *head) |
463 | { | 475 | { |
464 | return ((head->next != head) && (head->next == head->prev)); | 476 | return (head->next != head) && (head->next == head->prev); |
465 | } | 477 | } |
466 | 478 | ||
467 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ | 479 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ |
@@ -619,13 +631,13 @@ static inline int sctp_sanity_check(void) | |||
619 | /* This is the hash function for the SCTP port hash table. */ | 631 | /* This is the hash function for the SCTP port hash table. */ |
620 | static inline int sctp_phashfn(__u16 lport) | 632 | static inline int sctp_phashfn(__u16 lport) |
621 | { | 633 | { |
622 | return (lport & (sctp_port_hashsize - 1)); | 634 | return lport & (sctp_port_hashsize - 1); |
623 | } | 635 | } |
624 | 636 | ||
625 | /* This is the hash function for the endpoint hash table. */ | 637 | /* This is the hash function for the endpoint hash table. */ |
626 | static inline int sctp_ep_hashfn(__u16 lport) | 638 | static inline int sctp_ep_hashfn(__u16 lport) |
627 | { | 639 | { |
628 | return (lport & (sctp_ep_hashsize - 1)); | 640 | return lport & (sctp_ep_hashsize - 1); |
629 | } | 641 | } |
630 | 642 | ||
631 | /* This is the hash function for the association hash table. */ | 643 | /* This is the hash function for the association hash table. */ |
@@ -633,7 +645,7 @@ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) | |||
633 | { | 645 | { |
634 | int h = (lport << 16) + rport; | 646 | int h = (lport << 16) + rport; |
635 | h ^= h>>8; | 647 | h ^= h>>8; |
636 | return (h & (sctp_assoc_hashsize - 1)); | 648 | return h & (sctp_assoc_hashsize - 1); |
637 | } | 649 | } |
638 | 650 | ||
639 | /* This is the hash function for the association hash table. This is | 651 | /* This is the hash function for the association hash table. This is |
@@ -644,7 +656,7 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) | |||
644 | { | 656 | { |
645 | int h = (lport << 16) + rport; | 657 | int h = (lport << 16) + rport; |
646 | h ^= vtag; | 658 | h ^= vtag; |
647 | return (h & (sctp_assoc_hashsize-1)); | 659 | return h & (sctp_assoc_hashsize - 1); |
648 | } | 660 | } |
649 | 661 | ||
650 | #define sctp_for_each_hentry(epb, node, head) \ | 662 | #define sctp_for_each_hentry(epb, node, head) \ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 4088c89a9055..9352d12f02de 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -345,12 +345,12 @@ enum { | |||
345 | 345 | ||
346 | static inline int TSN_lt(__u32 s, __u32 t) | 346 | static inline int TSN_lt(__u32 s, __u32 t) |
347 | { | 347 | { |
348 | return (((s) - (t)) & TSN_SIGN_BIT); | 348 | return ((s) - (t)) & TSN_SIGN_BIT; |
349 | } | 349 | } |
350 | 350 | ||
351 | static inline int TSN_lte(__u32 s, __u32 t) | 351 | static inline int TSN_lte(__u32 s, __u32 t) |
352 | { | 352 | { |
353 | return (((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT)); | 353 | return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT); |
354 | } | 354 | } |
355 | 355 | ||
356 | /* Compare two SSNs */ | 356 | /* Compare two SSNs */ |
@@ -369,12 +369,12 @@ enum { | |||
369 | 369 | ||
370 | static inline int SSN_lt(__u16 s, __u16 t) | 370 | static inline int SSN_lt(__u16 s, __u16 t) |
371 | { | 371 | { |
372 | return (((s) - (t)) & SSN_SIGN_BIT); | 372 | return ((s) - (t)) & SSN_SIGN_BIT; |
373 | } | 373 | } |
374 | 374 | ||
375 | static inline int SSN_lte(__u16 s, __u16 t) | 375 | static inline int SSN_lte(__u16 s, __u16 t) |
376 | { | 376 | { |
377 | return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); | 377 | return ((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT); |
378 | } | 378 | } |
379 | 379 | ||
380 | /* | 380 | /* |
@@ -388,7 +388,7 @@ enum { | |||
388 | 388 | ||
389 | static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) | 389 | static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) |
390 | { | 390 | { |
391 | return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); | 391 | return ((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT); |
392 | } | 392 | } |
393 | 393 | ||
394 | /* Check VTAG of the packet matches the sender's own tag. */ | 394 | /* Check VTAG of the packet matches the sender's own tag. */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index f9e7473613bd..69fef4fb79c0 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -847,7 +847,7 @@ void sctp_packet_free(struct sctp_packet *); | |||
847 | 847 | ||
848 | static inline int sctp_packet_empty(struct sctp_packet *packet) | 848 | static inline int sctp_packet_empty(struct sctp_packet *packet) |
849 | { | 849 | { |
850 | return (packet->size == packet->overhead); | 850 | return packet->size == packet->overhead; |
851 | } | 851 | } |
852 | 852 | ||
853 | /* This represents a remote transport address. | 853 | /* This represents a remote transport address. |
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 4aabc5a96cf6..e7728bc14ccf 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h | |||
@@ -157,7 +157,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map); | |||
157 | /* Is there a gap in the TSN map? */ | 157 | /* Is there a gap in the TSN map? */ |
158 | static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) | 158 | static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) |
159 | { | 159 | { |
160 | return (map->cumulative_tsn_ack_point != map->max_tsn_seen); | 160 | return map->cumulative_tsn_ack_point != map->max_tsn_seen; |
161 | } | 161 | } |
162 | 162 | ||
163 | /* Mark a duplicate TSN. Note: limit the storage of duplicate TSN | 163 | /* Mark a duplicate TSN. Note: limit the storage of duplicate TSN |