Skip to content

Commit 014eb5c

Browse files
etsalAlexei Starovoitov
authored andcommitted
bpf: fix missing kdoc string fields in cpumask.c
Some bpf_cpumask-related kfuncs have kdoc strings that are missing return values. Add a the missing descriptions for the return values. Reported-by: Alexei Starovoitov <[email protected]> Signed-off-by: Emil Tsalapatis (Meta) <[email protected]> Acked-by: Hou Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 918ba26 commit 014eb5c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

kernel/bpf/cpumask.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ __bpf_kfunc_start_defs();
4545
*
4646
* bpf_cpumask_create() allocates memory using the BPF memory allocator, and
4747
* will not block. It may return NULL if no memory is available.
48+
*
49+
* Return:
50+
* * A pointer to a new struct bpf_cpumask instance on success.
51+
* * NULL if the BPF memory allocator is out of memory.
4852
*/
4953
__bpf_kfunc struct bpf_cpumask *bpf_cpumask_create(void)
5054
{
@@ -71,6 +75,10 @@ __bpf_kfunc struct bpf_cpumask *bpf_cpumask_create(void)
7175
* Acquires a reference to a BPF cpumask. The cpumask returned by this function
7276
* must either be embedded in a map as a kptr, or freed with
7377
* bpf_cpumask_release().
78+
*
79+
* Return:
80+
* * The struct bpf_cpumask pointer passed to the function.
81+
*
7482
*/
7583
__bpf_kfunc struct bpf_cpumask *bpf_cpumask_acquire(struct bpf_cpumask *cpumask)
7684
{
@@ -106,6 +114,9 @@ CFI_NOSEAL(bpf_cpumask_release_dtor);
106114
*
107115
* Find the index of the first nonzero bit of the cpumask. A struct bpf_cpumask
108116
* pointer may be safely passed to this function.
117+
*
118+
* Return:
119+
* * The index of the first nonzero bit in the struct cpumask.
109120
*/
110121
__bpf_kfunc u32 bpf_cpumask_first(const struct cpumask *cpumask)
111122
{
@@ -119,6 +130,9 @@ __bpf_kfunc u32 bpf_cpumask_first(const struct cpumask *cpumask)
119130
*
120131
* Find the index of the first unset bit of the cpumask. A struct bpf_cpumask
121132
* pointer may be safely passed to this function.
133+
*
134+
* Return:
135+
* * The index of the first zero bit in the struct cpumask.
122136
*/
123137
__bpf_kfunc u32 bpf_cpumask_first_zero(const struct cpumask *cpumask)
124138
{
@@ -133,6 +147,9 @@ __bpf_kfunc u32 bpf_cpumask_first_zero(const struct cpumask *cpumask)
133147
*
134148
* Find the index of the first nonzero bit of the AND of two cpumasks.
135149
* struct bpf_cpumask pointers may be safely passed to @src1 and @src2.
150+
*
151+
* Return:
152+
* * The index of the first bit that is nonzero in both cpumask instances.
136153
*/
137154
__bpf_kfunc u32 bpf_cpumask_first_and(const struct cpumask *src1,
138155
const struct cpumask *src2)
@@ -414,6 +431,9 @@ __bpf_kfunc u32 bpf_cpumask_any_and_distribute(const struct cpumask *src1,
414431
* @cpumask: The cpumask being queried.
415432
*
416433
* Count the number of set bits in the given cpumask.
434+
*
435+
* Return:
436+
* * The number of bits set in the mask.
417437
*/
418438
__bpf_kfunc u32 bpf_cpumask_weight(const struct cpumask *cpumask)
419439
{

0 commit comments

Comments
 (0)