summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2020-08-01 11:30:23 +0200
committerDavid S. Miller <davem@davemloft.net>2020-08-04 00:38:31 +0200
commitc15fc199b3757496325c4855662fad89bd1efdad (patch)
treeacdefdaa5afa66f613617cb362fd6fe6a23753c7 /net/core
parentnet: qed: use eth_zero_addr() to clear mac address (diff)
downloadlinux-c15fc199b3757496325c4855662fad89bd1efdad.tar.xz
linux-c15fc199b3757496325c4855662fad89bd1efdad.zip
net: Use __skb_pagelen() directly in skb_cow_data()
In fact, skb_pagelen() - skb_headlen() is equal to __skb_pagelen(), use it directly to avoid unnecessary skb_headlen() call. Also fix the CHECK note of checkpatch.pl: Comparison to NULL could be written "!__pskb_pull_tail" Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4e2edfbe0e19..97ad6523e490 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4413,7 +4413,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
* at the moment even if they are anonymous).
*/
if ((skb_cloned(skb) || skb_shinfo(skb)->nr_frags) &&
- __pskb_pull_tail(skb, skb_pagelen(skb)-skb_headlen(skb)) == NULL)
+ !__pskb_pull_tail(skb, __skb_pagelen(skb)))
return -ENOMEM;
/* Easy case. Most of packets will go this way. */