Skip to contentSkip to conversation

cred: cred.h: fix kernel-doc warnings

PATCH Applied Randy Dunlap 2 participants 2 messages Mar 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cred: cred.h: fix kernel-doc warnings

Use the correct function parameter names, function names, or kernel-doc format, and add function return comment sections to avoid kernel-doc warnings:

Warning: include/linux/cred.h:43 function parameter 'gi' not described
in 'get_group_info'
Warning: include/linux/cred.h:43 No description found for return value
of 'get_group_info'
Warning: include/linux/cred.h:213 No description found for return value
of 'get_cred_many'
Warning: include/linux/cred.h:260 function parameter '_cred' not described
in 'put_cred_many'
Warning: include/linux/cred.h:260 expecting prototype for put_cred().
Prototype was for put_cred_many() instead

---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]

 include/linux/cred.h |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
include/linux/cred.h +7 -3
@@ -33,12 +33,14 @@ struct group_info {
 
 /**
  * get_group_info - Get a reference to a group info structure
- * @group_info: The group info to reference
+ * @gi: The group info to reference
  *
  * This gets a reference to a set of supplementary groups.
  *
  * If the caller is accessing a task's credentials, they must hold the RCU read
  * lock when reading.
+ *
+ * Returns: @gi
  */
 static inline struct group_info *get_group_info(struct group_info *gi)
 {
@@ -209,6 +211,8 @@ DEFINE_CLASS(override_creds,
  * usage count.  The purpose of this is to attempt to catch at compile time the
  * accidental alteration of a set of credentials that should be considered
  * immutable.
+ *
+ * Returns: @cred when the references are acquired, NULL otherwise.
  */
 static inline const struct cred *get_cred_many(const struct cred *cred, int nr)
 {
@@ -246,8 +250,8 @@ static inline const struct cred *get_cre
 }
 
 /**
- * put_cred - Release a reference to a set of credentials
- * @cred: The credentials to release
+ * put_cred_many - Release a reference to a set of credentials
+ * @_cred: The credentials to release
  * @nr: Number of references to release
  *
  * Release a reference to a set of credentials, deleting them when the last ref
maintainer Applied
#1 lore raw
Quoted 16 lines · On Mar 1, 2026 Randy Dunlap <[email protected]> wrote:

Use the correct function parameter names, function names, or kernel-doc format, and add function return comment sections to avoid kernel-doc warnings:

Warning: include/linux/cred.h:43 function parameter 'gi' not described
in 'get_group_info'
Warning: include/linux/cred.h:43 No description found for return value
of 'get_group_info'
Warning: include/linux/cred.h:213 No description found for return value
of 'get_cred_many'
Warning: include/linux/cred.h:260 function parameter '_cred' not described
in 'put_cred_many'
Warning: include/linux/cred.h:260 expecting prototype for put_cred().
Prototype was for put_cred_many() instead

Quoted 8 lines

---
Cc: Paul Moore <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: [email protected]

 include/linux/cred.h |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Merged into lsm/dev, thanks.

--
paul-moore.com