* [PATCH] [NET] fix useless comment reference loop
@ 2008-05-03 22:05 Johannes Berg
2008-05-04 3:57 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2008-05-03 22:05 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
include/linux/skbuff.h says:
/* These elements must be at the end, see alloc_skb() for details. */
net/core/skbuff.c says:
* See comment in sk_buff definition, just before the 'tail' member
This patch contains my guess as to the actual reason rather than a
dead comment reference loop.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Not that it probably makes much of a difference anyway.
net/core/skbuff.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- everything.orig/net/core/skbuff.c 2008-05-04 00:01:25.000000000 +0200
+++ everything/net/core/skbuff.c 2008-05-04 00:02:41.000000000 +0200
@@ -206,7 +206,9 @@ struct sk_buff *__alloc_skb(unsigned int
goto nodata;
/*
- * See comment in sk_buff definition, just before the 'tail' member
+ * Only clear those fields we need to clear, not those that we will
+ * actually initialise below. Hence, don't put any more fields after
+ * the tail pointer in struct sk_buff!
*/
memset(skb, 0, offsetof(struct sk_buff, tail));
skb->truesize = size + sizeof(struct sk_buff);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] [NET] fix useless comment reference loop
2008-05-03 22:05 [PATCH] [NET] fix useless comment reference loop Johannes Berg
@ 2008-05-04 3:57 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-05-04 3:57 UTC (permalink / raw)
To: johannes; +Cc: netdev
From: Johannes Berg <johannes@sipsolutions.net>
Date: Sun, 04 May 2008 00:05:42 +0200
> include/linux/skbuff.h says:
> /* These elements must be at the end, see alloc_skb() for details. */
>
> net/core/skbuff.c says:
> * See comment in sk_buff definition, just before the 'tail' member
>
> This patch contains my guess as to the actual reason rather than a
> dead comment reference loop.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Patch applied, thanks.
This is an example of why I'm personally a comment minimalist.
They tend to rot, confuse people, and often just duplicate what
is obvious from the code (although not in this case).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-04 3:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-03 22:05 [PATCH] [NET] fix useless comment reference loop Johannes Berg
2008-05-04 3:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox