diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-22 02:59:22 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-22 02:59:22 -0400 |
commit | af426d327c38bcb8cbb87c60134d42d2e93b20cc (patch) | |
tree | 913af84609a80231cf38d1f64e5775fb66121c95 /net/llc/llc_conn.c | |
parent | 0eb8017242cb7e8b18af4751b03646436b8f90e3 (diff) |
[LLC]: Help the compiler with likely/unlikely, saving some more bytes
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/llc/llc_conn.c')
-rw-r--r-- | net/llc/llc_conn.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index 1f659e56d8e2..ce7b893ed1ab 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c | |||
@@ -64,12 +64,12 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb) | |||
64 | skb_get(skb); | 64 | skb_get(skb); |
65 | ev->ind_prim = ev->cfm_prim = 0; | 65 | ev->ind_prim = ev->cfm_prim = 0; |
66 | rc = llc_conn_service(sk, skb); /* sending event to state machine */ | 66 | rc = llc_conn_service(sk, skb); /* sending event to state machine */ |
67 | if (rc) { | 67 | if (unlikely(rc != 0)) { |
68 | printk(KERN_ERR "%s: llc_conn_service failed\n", __FUNCTION__); | 68 | printk(KERN_ERR "%s: llc_conn_service failed\n", __FUNCTION__); |
69 | goto out_kfree_skb; | 69 | goto out_kfree_skb; |
70 | } | 70 | } |
71 | 71 | ||
72 | if (!ev->ind_prim && !ev->cfm_prim) { | 72 | if (unlikely(!ev->ind_prim && !ev->cfm_prim)) { |
73 | /* indicate or confirm not required */ | 73 | /* indicate or confirm not required */ |
74 | /* XXX this is not very pretty, perhaps we should store | 74 | /* XXX this is not very pretty, perhaps we should store |
75 | * XXX indicate/confirm-needed state in the llc_conn_state_ev | 75 | * XXX indicate/confirm-needed state in the llc_conn_state_ev |
@@ -80,7 +80,7 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb) | |||
80 | goto out_skb_put; | 80 | goto out_skb_put; |
81 | } | 81 | } |
82 | 82 | ||
83 | if (ev->ind_prim && ev->cfm_prim) /* Paranoia */ | 83 | if (unlikely(ev->ind_prim && ev->cfm_prim)) /* Paranoia */ |
84 | skb_get(skb); | 84 | skb_get(skb); |
85 | 85 | ||
86 | switch (ev->ind_prim) { | 86 | switch (ev->ind_prim) { |
@@ -762,14 +762,14 @@ static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
762 | int rc = 0; | 762 | int rc = 0; |
763 | struct llc_sock *llc = llc_sk(sk); | 763 | struct llc_sock *llc = llc_sk(sk); |
764 | 764 | ||
765 | if (llc_backlog_type(skb) == LLC_PACKET) { | 765 | if (likely(llc_backlog_type(skb) == LLC_PACKET)) { |
766 | if (llc->state > 1) /* not closed */ | 766 | if (likely(llc->state > 1)) /* not closed */ |
767 | rc = llc_conn_rcv(sk, skb); | 767 | rc = llc_conn_rcv(sk, skb); |
768 | else | 768 | else |
769 | goto out_kfree_skb; | 769 | goto out_kfree_skb; |
770 | } else if (llc_backlog_type(skb) == LLC_EVENT) { | 770 | } else if (llc_backlog_type(skb) == LLC_EVENT) { |
771 | /* timer expiration event */ | 771 | /* timer expiration event */ |
772 | if (llc->state > 1) /* not closed */ | 772 | if (likely(llc->state > 1)) /* not closed */ |
773 | rc = llc_conn_state_process(sk, skb); | 773 | rc = llc_conn_state_process(sk, skb); |
774 | else | 774 | else |
775 | goto out_kfree_skb; | 775 | goto out_kfree_skb; |