Skip to content

Commit

Permalink
[NET]: sk_add_backlog convert from macro to inline
Browse files Browse the repository at this point in the history
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: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 8, 2005
1 parent b541ca2 commit 9ee6b53
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
#define sk_add_backlog(__sk, __skb) \
do { if (!(__sk)->sk_backlog.tail) { \
(__sk)->sk_backlog.head = \
(__sk)->sk_backlog.tail = (__skb); \
} else { \
((__sk)->sk_backlog.tail)->next = (__skb); \
(__sk)->sk_backlog.tail = (__skb); \
} \
(__skb)->next = NULL; \
} while(0)
static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
{
if (!sk->sk_backlog.tail) {
sk->sk_backlog.head = sk->sk_backlog.tail = skb;
} else {
sk->sk_backlog.tail->next = skb;
sk->sk_backlog.tail = skb;
}
skb->next = NULL;
}

#define sk_wait_event(__sk, __timeo, __condition) \
({ int rc; \
Expand Down

0 comments on commit 9ee6b53

Please sign in to comment.