提交 9ee6b535 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

[NET]: sk_add_backlog convert from macro to inline

There is no reason for sk_add_backlog to be a macro. It can
just be an inline function and get type checking.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b541ca2c
...@@ -461,16 +461,16 @@ static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) ...@@ -461,16 +461,16 @@ static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
} }
/* The per-socket spinlock must be held here. */ /* The per-socket spinlock must be held here. */
#define sk_add_backlog(__sk, __skb) \ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
do { if (!(__sk)->sk_backlog.tail) { \ {
(__sk)->sk_backlog.head = \ if (!sk->sk_backlog.tail) {
(__sk)->sk_backlog.tail = (__skb); \ sk->sk_backlog.head = sk->sk_backlog.tail = skb;
} else { \ } else {
((__sk)->sk_backlog.tail)->next = (__skb); \ sk->sk_backlog.tail->next = skb;
(__sk)->sk_backlog.tail = (__skb); \ sk->sk_backlog.tail = skb;
} \ }
(__skb)->next = NULL; \ skb->next = NULL;
} while(0) }
#define sk_wait_event(__sk, __timeo, __condition) \ #define sk_wait_event(__sk, __timeo, __condition) \
({ int rc; \ ({ int rc; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册