From: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Date: Fri, 13 May 2022 17:34:00 +0000 (-0700)
Subject: net: skb: Remove skb_data_area_size()
X-Git-Tag: howlett/maple/20220722_2~466^2~93^2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=89af2ce2d95c80f6da9388d9da2e35c84c2573b1;p=users%2Fjedix%2Flinux-maple.git

net: skb: Remove skb_data_area_size()

skb_data_area_size() is not needed. As Jakub pointed out [1]:
For Rx, drivers can use the size passed during skb allocation or
use skb_tailroom().
For Tx, drivers should use skb_headlen().

[1] https://lore.kernel.org/netdev/CAHNKnsTmH-rGgWi3jtyC=ktM1DW2W1VJkYoTMJV2Z_Bt498bsg@mail.gmail.com/

Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5a2b29df6cab..da96f0d3e753 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1765,11 +1765,6 @@ static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset)
 }
 #endif
 
-static inline unsigned int skb_data_area_size(struct sk_buff *skb)
-{
-	return skb_end_pointer(skb) - skb->data;
-}
-
 struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size,
 				       struct ubuf_info *uarg);