Skip to content

Commit 4ea7b0c

Browse files
computersforpeacedavem330
authored andcommitted
net/skbuff: fix up kernel-doc placement
There are several skb_* functions where the locked and unlocked functions are confusingly documented. For several of them, the kernel-doc for the unlocked version is placed above the locked version, which to the casual reader makes it seems like the locked version "takes no locks and you must therefore hold required locks before calling it." One can see, for example, that this link claims to document skb_queue_head(), while instead describing __skb_queue_head(). https://www.kernel.org/doc/html/latest/networking/kapi.html#c.skb_queue_head The correct documentation for skb_queue_head() is also included further down the page. This diff tested via: $ scripts/kernel-doc -rst include/linux/skbuff.h net/core/skbuff.c No new warnings were seen, and the output makes a little more sense. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 317d8e2 commit 4ea7b0c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎include/linux/skbuff.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,12 +1889,12 @@ static inline void __skb_queue_before(struct sk_buff_head *list,
18891889
*
18901890
* A buffer cannot be placed on two lists at the same time.
18911891
*/
1892-
void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
18931892
static inline void __skb_queue_head(struct sk_buff_head *list,
18941893
struct sk_buff *newsk)
18951894
{
18961895
__skb_queue_after(list, (struct sk_buff *)list, newsk);
18971896
}
1897+
void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
18981898

18991899
/**
19001900
* __skb_queue_tail - queue a buffer at the list tail
@@ -1906,12 +1906,12 @@ static inline void __skb_queue_head(struct sk_buff_head *list,
19061906
*
19071907
* A buffer cannot be placed on two lists at the same time.
19081908
*/
1909-
void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);
19101909
static inline void __skb_queue_tail(struct sk_buff_head *list,
19111910
struct sk_buff *newsk)
19121911
{
19131912
__skb_queue_before(list, (struct sk_buff *)list, newsk);
19141913
}
1914+
void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);
19151915

19161916
/*
19171917
* remove sk_buff from list. _Must_ be called atomically, and with
@@ -1938,14 +1938,14 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list)
19381938
* so must be used with appropriate locks held only. The head item is
19391939
* returned or %NULL if the list is empty.
19401940
*/
1941-
struct sk_buff *skb_dequeue(struct sk_buff_head *list);
19421941
static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
19431942
{
19441943
struct sk_buff *skb = skb_peek(list);
19451944
if (skb)
19461945
__skb_unlink(skb, list);
19471946
return skb;
19481947
}
1948+
struct sk_buff *skb_dequeue(struct sk_buff_head *list);
19491949

19501950
/**
19511951
* __skb_dequeue_tail - remove from the tail of the queue
@@ -1955,14 +1955,14 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
19551955
* so must be used with appropriate locks held only. The tail item is
19561956
* returned or %NULL if the list is empty.
19571957
*/
1958-
struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list);
19591958
static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
19601959
{
19611960
struct sk_buff *skb = skb_peek_tail(list);
19621961
if (skb)
19631962
__skb_unlink(skb, list);
19641963
return skb;
19651964
}
1965+
struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list);
19661966

19671967

19681968
static inline bool skb_is_nonlinear(const struct sk_buff *skb)
@@ -2653,13 +2653,13 @@ static inline int skb_orphan_frags_rx(struct sk_buff *skb, gfp_t gfp_mask)
26532653
* the list and one reference dropped. This function does not take the
26542654
* list lock and the caller must hold the relevant locks to use it.
26552655
*/
2656-
void skb_queue_purge(struct sk_buff_head *list);
26572656
static inline void __skb_queue_purge(struct sk_buff_head *list)
26582657
{
26592658
struct sk_buff *skb;
26602659
while ((skb = __skb_dequeue(list)) != NULL)
26612660
kfree_skb(skb);
26622661
}
2662+
void skb_queue_purge(struct sk_buff_head *list);
26632663

26642664
unsigned int skb_rbtree_purge(struct rb_root *root);
26652665

@@ -3028,7 +3028,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len)
30283028
}
30293029

30303030
/**
3031-
* skb_put_padto - increase size and pad an skbuff up to a minimal size
3031+
* __skb_put_padto - increase size and pad an skbuff up to a minimal size
30323032
* @skb: buffer to pad
30333033
* @len: minimal length
30343034
* @free_on_error: free buffer on error

0 commit comments

Comments
 (0)