lkml.org 
[lkml]   [2021]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: kerneldoc warnings since commit 538fc2ee870a3 ("rcu: Introduce kfree_rcu() single-argument macro")
Dear, Lukas.

> Dear Uladzislau,
>
> in commit 538fc2ee870a3 ("rcu: Introduce kfree_rcu() single-argument
> macro"), you have refactored the kfree_rcu macro.
>
> Since then, make htmldocs warns:
>
> ./include/linux/rcupdate.h:882: warning: Excess function parameter
> 'ptr' description in 'kfree_rcu'
> ./include/linux/rcupdate.h:882: warning: Excess function parameter
> 'rhf' description in 'kfree_rcu'
>
> As you deleted the two arguments in the macro definition, kerneldoc
> cannot resolve the argument names in the macro's kerneldoc
> documentation anymore and warns about that.
>
> Probably, it is best to just turn the formal kerneldoc references to
> the two arguments, which are not used in the macro definition anymore,
> simply into two informal references in the documentation.
>
Thanks for your suggestion. I am not sure if htmldocs supports something
like "__maybe_unused", but tend to say that it does not. See below the
patch:

<snip>
From 65ecc7c58810c963c02e0596ce2e5758c54ef55d Mon Sep 17 00:00:00 2001
From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Date: Tue, 5 Jan 2021 13:23:30 +0100
Subject: [PATCH] rcu: fix kerneldoc warnings

After refactoring of the kfree_rcu(), it becomes possible to use
the macro with one or two arguments. From the other hand, in the
description there are two arguments in the macro definition expected.
That is why the "htmldocs" emits a warning about it:

<snip>
./include/linux/rcupdate.h:882: warning: Excess function parameter
'ptr' description in 'kfree_rcu'
./include/linux/rcupdate.h:882: warning: Excess function parameter
'rhf' description in 'kfree_rcu'
<snip>

Fix it by converting two parameters into informal references in the
macro description.

Fixes: 3d3d9ff077a9 ("rcu: Introduce kfree_rcu() single-argument macro")
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
include/linux/rcupdate.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index ebd8dcca4997..e678ce7f5ca2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -854,8 +854,8 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)

/**
* kfree_rcu() - kfree an object after a grace period.
- * @ptr: pointer to kfree for both single- and double-argument invocations.
- * @rhf: the name of the struct rcu_head within the type of @ptr,
+ * ptr: pointer to kfree for both single- and double-argument invocations.
+ * rhf: the name of the struct rcu_head within the type of ptr,
* but only for double-argument invocations.
*
* Many rcu callbacks functions just call kfree() on the base structure.
--
2.20.1
<snip>
Paul, does it work for you?

Thanks!

--
Vlad Rezki

\
 
 \ /
  Last update: 2021-01-05 14:18    [W:0.064 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site