From: Ziran Zhang <zhangcoder@yeah.net>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Ziran Zhang <zhangcoder@yeah.net>
Subject: [PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push()
Date: Fri, 24 Jul 2026 23:06:59 +0800 [thread overview]
Message-ID: <20260724150659.6100-1-zhangcoder@yeah.net> (raw)
Both functions only move the tail/data pointer, they do not copy data.
Update the function descriptions and @len parameter, so they can accurately
reflect the semantics.
Signed-off-by: Ziran Zhang <zhangcoder@yeah.net>
---
net/core/skbuff.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 18dabb4e9..35ad782ad 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2614,9 +2614,9 @@ void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
EXPORT_SYMBOL_GPL(pskb_put);
/**
- * skb_put - add data to a buffer
+ * skb_put - extend the data area at the tail of a buffer
* @skb: buffer to use
- * @len: amount of data to add
+ * @len: number of bytes to extend
*
* This function extends the used data area of the buffer. If this would
* exceed the total buffer size the kernel will panic. A pointer to the
@@ -2635,9 +2635,9 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
EXPORT_SYMBOL(skb_put);
/**
- * skb_push - add data to the start of a buffer
+ * skb_push - extend the data area at the start of a buffer
* @skb: buffer to use
- * @len: amount of data to add
+ * @len: number of bytes to extend
*
* This function extends the used data area of the buffer at the buffer
* start. If this would exceed the total buffer headroom the kernel will
--
2.43.0
reply other threads:[~2026-07-24 15:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260724150659.6100-1-zhangcoder@yeah.net \
--to=zhangcoder@yeah.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox