Commit 24b3e3dd authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

kernfs: fix all kernel-doc warnings and multiple typos

Fix kernel-doc warnings. Many of these are about a function's
return value, so use the kernel-doc Return: format to fix those

Use % prefix on numeric constant values.

dir.c: fix typos/spellos
file.c fix typo: s/taret/target/

Fix all of these kernel-doc warnings:

dir.c:305: warning: missing initial short description on line:
 *      kernfs_name_hash

dir.c:137: warning: No description found for return value of 'kernfs_path_from_node_locked'
dir.c:196: warning: No description found for return value of 'kernfs_name'
dir.c:224: warning: No description found for return value of 'kernfs_path_from_node'
dir.c:292: warning: No description found for return value of 'kernfs_get_parent'
dir.c:312: warning: No description found for return value of 'kernfs_name_hash'
dir.c:404: warning: No description found for return value of 'kernfs_unlink_sibling'
dir.c:588: warning: No description found for return value of 'kernfs_node_from_dentry'
dir.c:806: warning: No description found for return value of 'kernfs_find_ns'
dir.c:879: warning: No description found for return value of 'kernfs_find_and_get_ns'
dir.c:904: warning: No description found for return value of 'kernfs_walk_and_get_ns'
dir.c:927: warning: No description found for return value of 'kernfs_create_root'
dir.c:996: warning: No description found for return value of 'kernfs_root_to_node'
dir.c:1016: warning: No description found for return value of 'kernfs_create_dir_ns'
dir.c:1048: warning: No description found for return value of 'kernfs_create_empty_dir'
dir.c:1306: warning: No description found for return value of 'kernfs_next_descendant_post'
dir.c:1568: warning: No description found for return value of 'kernfs_remove_self'
dir.c:1630: warning: No description found for return value of 'kernfs_remove_by_name_ns'
dir.c:1667: warning: No description found for return value of 'kernfs_rename_ns'

file.c:66: warning: No description found for return value of 'of_on'
file.c:88: warning: No description found for return value of 'kernfs_deref_open_node_locked'
file.c:1036: warning: No description found for return value of '__kernfs_create_file'

inode.c:100: warning: No description found for return value of 'kernfs_setattr'

mount.c:160: warning: No description found for return value of 'kernfs_root_from_sb'
mount.c:198: warning: No description found for return value of 'kernfs_node_dentry'
mount.c:302: warning: No description found for return value of 'kernfs_super_ns'
mount.c:318: warning: No description found for return value of 'kernfs_get_tree'

symlink.c:28: warning: No description found for return value of 'kernfs_create_link'
Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20221112031456.22980-1-rdunlap@infradead.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f041c5d
This diff is collapsed.
...@@ -33,7 +33,7 @@ struct kernfs_open_node { ...@@ -33,7 +33,7 @@ struct kernfs_open_node {
* pending queue is implemented as a singly linked list of kernfs_nodes. * pending queue is implemented as a singly linked list of kernfs_nodes.
* The list is terminated with the self pointer so that whether a * The list is terminated with the self pointer so that whether a
* kernfs_node is on the list or not can be determined by testing the next * kernfs_node is on the list or not can be determined by testing the next
* pointer for NULL. * pointer for %NULL.
*/ */
#define KERNFS_NOTIFY_EOL ((void *)&kernfs_notify_list) #define KERNFS_NOTIFY_EOL ((void *)&kernfs_notify_list)
...@@ -59,8 +59,10 @@ static inline struct mutex *kernfs_open_file_mutex_lock(struct kernfs_node *kn) ...@@ -59,8 +59,10 @@ static inline struct mutex *kernfs_open_file_mutex_lock(struct kernfs_node *kn)
} }
/** /**
* of_on - Return the kernfs_open_node of the specified kernfs_open_file * of_on - Get the kernfs_open_node of the specified kernfs_open_file
* @of: taret kernfs_open_file * @of: target kernfs_open_file
*
* Return: the kernfs_open_node of the kernfs_open_file
*/ */
static struct kernfs_open_node *of_on(struct kernfs_open_file *of) static struct kernfs_open_node *of_on(struct kernfs_open_file *of)
{ {
...@@ -82,6 +84,8 @@ static struct kernfs_open_node *of_on(struct kernfs_open_file *of) ...@@ -82,6 +84,8 @@ static struct kernfs_open_node *of_on(struct kernfs_open_file *of)
* outside RCU read-side critical section. * outside RCU read-side critical section.
* *
* The caller needs to make sure that kernfs_open_file_mutex is held. * The caller needs to make sure that kernfs_open_file_mutex is held.
*
* Return: @kn->attr.open when kernfs_open_file_mutex is held.
*/ */
static struct kernfs_open_node * static struct kernfs_open_node *
kernfs_deref_open_node_locked(struct kernfs_node *kn) kernfs_deref_open_node_locked(struct kernfs_node *kn)
...@@ -548,11 +552,11 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -548,11 +552,11 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
* If @kn->attr.open exists, increment its reference count; otherwise, * If @kn->attr.open exists, increment its reference count; otherwise,
* create one. @of is chained to the files list. * create one. @of is chained to the files list.
* *
* LOCKING: * Locking:
* Kernel thread context (may sleep). * Kernel thread context (may sleep).
* *
* RETURNS: * Return:
* 0 on success, -errno on failure. * %0 on success, -errno on failure.
*/ */
static int kernfs_get_open_node(struct kernfs_node *kn, static int kernfs_get_open_node(struct kernfs_node *kn,
struct kernfs_open_file *of) struct kernfs_open_file *of)
...@@ -1024,7 +1028,7 @@ const struct file_operations kernfs_file_fops = { ...@@ -1024,7 +1028,7 @@ const struct file_operations kernfs_file_fops = {
* @ns: optional namespace tag of the file * @ns: optional namespace tag of the file
* @key: lockdep key for the file's active_ref, %NULL to disable lockdep * @key: lockdep key for the file's active_ref, %NULL to disable lockdep
* *
* Returns the created node on success, ERR_PTR() value on error. * Return: the created node on success, ERR_PTR() value on error.
*/ */
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
const char *name, const char *name,
......
...@@ -94,7 +94,7 @@ int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) ...@@ -94,7 +94,7 @@ int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)
* @kn: target node * @kn: target node
* @iattr: iattr to set * @iattr: iattr to set
* *
* Returns 0 on success, -errno on failure. * Return: %0 on success, -errno on failure.
*/ */
int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)
{ {
...@@ -239,11 +239,11 @@ static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode) ...@@ -239,11 +239,11 @@ static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode)
* allocated and basics are initialized. New inode is returned * allocated and basics are initialized. New inode is returned
* locked. * locked.
* *
* LOCKING: * Locking:
* Kernel thread context (may sleep). * Kernel thread context (may sleep).
* *
* RETURNS: * Return:
* Pointer to allocated inode on success, NULL on failure. * Pointer to allocated inode on success, %NULL on failure.
*/ */
struct inode *kernfs_get_inode(struct super_block *sb, struct kernfs_node *kn) struct inode *kernfs_get_inode(struct super_block *sb, struct kernfs_node *kn)
{ {
......
...@@ -58,7 +58,7 @@ struct kernfs_root { ...@@ -58,7 +58,7 @@ struct kernfs_root {
* kernfs_root - find out the kernfs_root a kernfs_node belongs to * kernfs_root - find out the kernfs_root a kernfs_node belongs to
* @kn: kernfs_node of interest * @kn: kernfs_node of interest
* *
* Return the kernfs_root @kn belongs to. * Return: the kernfs_root @kn belongs to.
*/ */
static inline struct kernfs_root *kernfs_root(struct kernfs_node *kn) static inline struct kernfs_root *kernfs_root(struct kernfs_node *kn)
{ {
......
...@@ -153,7 +153,7 @@ static const struct export_operations kernfs_export_ops = { ...@@ -153,7 +153,7 @@ static const struct export_operations kernfs_export_ops = {
* kernfs_root_from_sb - determine kernfs_root associated with a super_block * kernfs_root_from_sb - determine kernfs_root associated with a super_block
* @sb: the super_block in question * @sb: the super_block in question
* *
* Return the kernfs_root associated with @sb. If @sb is not a kernfs one, * Return: the kernfs_root associated with @sb. If @sb is not a kernfs one,
* %NULL is returned. * %NULL is returned.
*/ */
struct kernfs_root *kernfs_root_from_sb(struct super_block *sb) struct kernfs_root *kernfs_root_from_sb(struct super_block *sb)
...@@ -167,7 +167,7 @@ struct kernfs_root *kernfs_root_from_sb(struct super_block *sb) ...@@ -167,7 +167,7 @@ struct kernfs_root *kernfs_root_from_sb(struct super_block *sb)
* find the next ancestor in the path down to @child, where @parent was the * find the next ancestor in the path down to @child, where @parent was the
* ancestor whose descendant we want to find. * ancestor whose descendant we want to find.
* *
* Say the path is /a/b/c/d. @child is d, @parent is NULL. We return the root * Say the path is /a/b/c/d. @child is d, @parent is %NULL. We return the root
* node. If @parent is b, then we return the node for c. * node. If @parent is b, then we return the node for c.
* Passing in d as @parent is not ok. * Passing in d as @parent is not ok.
*/ */
...@@ -192,6 +192,8 @@ static struct kernfs_node *find_next_ancestor(struct kernfs_node *child, ...@@ -192,6 +192,8 @@ static struct kernfs_node *find_next_ancestor(struct kernfs_node *child,
* kernfs_node_dentry - get a dentry for the given kernfs_node * kernfs_node_dentry - get a dentry for the given kernfs_node
* @kn: kernfs_node for which a dentry is needed * @kn: kernfs_node for which a dentry is needed
* @sb: the kernfs super_block * @sb: the kernfs super_block
*
* Return: the dentry pointer
*/ */
struct dentry *kernfs_node_dentry(struct kernfs_node *kn, struct dentry *kernfs_node_dentry(struct kernfs_node *kn,
struct super_block *sb) struct super_block *sb)
...@@ -296,7 +298,7 @@ static int kernfs_set_super(struct super_block *sb, struct fs_context *fc) ...@@ -296,7 +298,7 @@ static int kernfs_set_super(struct super_block *sb, struct fs_context *fc)
* kernfs_super_ns - determine the namespace tag of a kernfs super_block * kernfs_super_ns - determine the namespace tag of a kernfs super_block
* @sb: super_block of interest * @sb: super_block of interest
* *
* Return the namespace tag associated with kernfs super_block @sb. * Return: the namespace tag associated with kernfs super_block @sb.
*/ */
const void *kernfs_super_ns(struct super_block *sb) const void *kernfs_super_ns(struct super_block *sb)
{ {
...@@ -313,6 +315,8 @@ const void *kernfs_super_ns(struct super_block *sb) ...@@ -313,6 +315,8 @@ const void *kernfs_super_ns(struct super_block *sb)
* implementation, which should set the specified ->@fs_type and ->@flags, and * implementation, which should set the specified ->@fs_type and ->@flags, and
* specify the hierarchy and namespace tag to mount via ->@root and ->@ns, * specify the hierarchy and namespace tag to mount via ->@root and ->@ns,
* respectively. * respectively.
*
* Return: %0 on success, -errno on failure.
*/ */
int kernfs_get_tree(struct fs_context *fc) int kernfs_get_tree(struct fs_context *fc)
{ {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* @name: name of the symlink * @name: name of the symlink
* @target: target node for the symlink to point to * @target: target node for the symlink to point to
* *
* Returns the created node on success, ERR_PTR() value on error. * Return: the created node on success, ERR_PTR() value on error.
* Ownership of the link matches ownership of the target. * Ownership of the link matches ownership of the target.
*/ */
struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment