Skip to content

Commit 242c1a2

Browse files
gfreewinddavem330
authored andcommitted
net: Remove useless function skb_header_release
There is no one which would invokes the function skb_header_release. So just remove it now. Signed-off-by: Gao Feng <gfree.wind@vip.163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dd54379 commit 242c1a2

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

drivers/net/usb/asix_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
245245
* - We are allowed to put 4 bytes at tail if skb_cloned()
246246
* is false (and if we have 4 bytes of tailroom)
247247
*
248-
* TCP packets for example are cloned, but skb_header_release()
248+
* TCP packets for example are cloned, but __skb_header_release()
249249
* was called in tcp stack, allowing us to use headroom for our needs.
250250
*/
251251
if (!skb_header_cloned(skb) &&

include/linux/skbuff.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,28 +1456,9 @@ static inline int skb_header_unclone(struct sk_buff *skb, gfp_t pri)
14561456
return 0;
14571457
}
14581458

1459-
/**
1460-
* skb_header_release - release reference to header
1461-
* @skb: buffer to operate on
1462-
*
1463-
* Drop a reference to the header part of the buffer. This is done
1464-
* by acquiring a payload reference. You must not read from the header
1465-
* part of skb->data after this.
1466-
* Note : Check if you can use __skb_header_release() instead.
1467-
*/
1468-
static inline void skb_header_release(struct sk_buff *skb)
1469-
{
1470-
BUG_ON(skb->nohdr);
1471-
skb->nohdr = 1;
1472-
atomic_add(1 << SKB_DATAREF_SHIFT, &skb_shinfo(skb)->dataref);
1473-
}
1474-
14751459
/**
14761460
* __skb_header_release - release reference to header
14771461
* @skb: buffer to operate on
1478-
*
1479-
* Variant of skb_header_release() assuming skb is private to caller.
1480-
* We can avoid one atomic operation.
14811462
*/
14821463
static inline void __skb_header_release(struct sk_buff *skb)
14831464
{

net/batman-adv/soft-interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
6969
int result;
7070

7171
/* TODO: We must check if we can release all references to non-payload
72-
* data using skb_header_release in our skbs to allow skb_cow_header to
72+
* data using __skb_header_release in our skbs to allow skb_cow_header to
7373
* work optimally. This means that those skbs are not allowed to read
7474
* or write any data which is before the current position of skb->data
7575
* after that call and thus allow other skbs with the same data buffer

0 commit comments

Comments
 (0)