Skip to contentSkip to conversation

: In-line ccid3_hc_tx_insert_options

PATCH In review Gerrit Renker 2 participants 2 messages Dec 7, 2006 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 4/12 : In-line ccid3_hc_tx_insert_options

[CCID 3]: In-line ccid3_hc_tx_insert_options

The function ccid3_hc_tx_insert_options currently only does a no-op, since the operation

  DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;

is already performed _unconditionally_ in ccid3_hc_tx_send_packet.

This redundancy is removed and the remaining stub function inlined.

---
 net/dccp/ccids/ccid3.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
net/dccp/ccids/ccid3.c +1 -7
@@ -551,14 +551,8 @@ static void ccid3_hc_tx_packet_recv(stru
 	}
 }
 
-static int ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb)
+static inline int ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb)
 {
-	const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
-
-	BUG_ON(hctx = NULL);
-
-	if (sk->sk_state = DCCP_OPEN || sk->sk_state = DCCP_PARTOPEN)
-		DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
 	return 0;
 }
 
#1 lore raw
Quoted 5 lines · Gerrit Renker

[CCID 3]: In-line ccid3_hc_tx_insert_options

The function ccid3_hc_tx_insert_options currently only does a no-op, since the operation

Quoted 7 lines
  DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;

is already performed _unconditionally_ in ccid3_hc_tx_send_packet.

This redundancy is removed and the remaining stub function inlined.

Gerrit,

A couple of points here:
- the whole ccid3_hc_tx_insert_options could actually be removed with a little work as there is no ccid2 equivalent and so the whole thing isn't needed! If you want I can tidy that one up or up to you.
- don't inline functions - at the moment people are saying let gcc decide when to do it - see comments in linus' git tree recently.

Ian

Signature · 3 lines
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group