Commit 5c1e686b authored by Stephen Hemminger's avatar Stephen Hemminger

[NET]: More likely/unlikely in skbuff.h

parent 5d8666eb
...@@ -885,7 +885,7 @@ static inline char *__skb_pull(struct sk_buff *skb, unsigned int len) ...@@ -885,7 +885,7 @@ static inline char *__skb_pull(struct sk_buff *skb, unsigned int len)
*/ */
static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len)
{ {
return (len > skb->len) ? NULL : __skb_pull(skb, len); return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len);
} }
extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
...@@ -901,7 +901,7 @@ static inline char *__pskb_pull(struct sk_buff *skb, unsigned int len) ...@@ -901,7 +901,7 @@ static inline char *__pskb_pull(struct sk_buff *skb, unsigned int len)
static inline unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len) static inline unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len)
{ {
return (len > skb->len) ? NULL : __pskb_pull(skb, len); return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len);
} }
static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
...@@ -1052,7 +1052,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, ...@@ -1052,7 +1052,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
int gfp_mask) int gfp_mask)
{ {
struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
if (skb) if (likely(skb))
skb_reserve(skb, 16); skb_reserve(skb, 16);
return skb; return skb;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment