Message ID | 1505968771-92232-1-git-send-email-gfree.wind@vip.163.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
Series | [net-next] net: Remove useless function skb_header_release | expand |
On Thu, 2017-09-21 at 12:39 +0800, gfree.wind@vip.163.com wrote: > From: Gao Feng <gfree.wind@vip.163.com> > > There is no one which would invokes the function skb_header_release. > So just remove it now. This in incomplete. There are other references to this function. $ git grep -w skb_header_release drivers/net/usb/asix_common.c: * TCP packets for example are cloned, but skb_header_release() include/linux/skbuff.h: * skb_header_release - release reference to header include/linux/skbuff.h:static inline void skb_header_release(struct sk_buff *skb) include/linux/skbuff.h: * Variant of skb_header_release() assuming skb is private to caller. net/batman-adv/soft-interface.c: * data using skb_header_release in our skbs to allow skb_cow_header to
>On Thu, 2017-09-21 at 12:39 +0800, gfree.wind@vip.163.com wrote: >> From: Gao Feng <gfree.wind@vip.163.com> >> >> There is no one which would invokes the function skb_header_release. >> So just remove it now. > >This in incomplete. >There are other references to this function. > >$ git grep -w skb_header_release >drivers/net/usb/asix_common.c: * TCP packets for example are cloned, but skb_header_release() >include/linux/skbuff.h: * skb_header_release - release reference to header >include/linux/skbuff.h:static inline void skb_header_release(struct sk_buff *skb) >include/linux/skbuff.h: * Variant of skb_header_release() assuming skb is private to caller. >net/batman-adv/soft-interface.c: * data using skb_header_release in our skbs to allow skb_cow_header to But there are comments, not real codes. Unless the skb_header_release may be used in the external modules Best Regards Feng
From: gfree.wind@vip.163.com Date: Thu, 21 Sep 2017 12:39:31 +0800 > From: Gao Feng <gfree.wind@vip.163.com> > > 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> As Joe Perches mentioned, there are comment references remaining. This should be removed too because they can be confusing for people. Thanks.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 72299ef..ce632cd 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1457,22 +1457,6 @@ static inline int skb_header_unclone(struct sk_buff *skb, gfp_t pri) } /** - * skb_header_release - release reference to header - * @skb: buffer to operate on - * - * Drop a reference to the header part of the buffer. This is done - * by acquiring a payload reference. You must not read from the header - * part of skb->data after this. - * Note : Check if you can use __skb_header_release() instead. - */ -static inline void skb_header_release(struct sk_buff *skb) -{ - BUG_ON(skb->nohdr); - skb->nohdr = 1; - atomic_add(1 << SKB_DATAREF_SHIFT, &skb_shinfo(skb)->dataref); -} - -/** * __skb_header_release - release reference to header * @skb: buffer to operate on *