mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] include/linux/dcache.h: fix warning in doc comment
@ 2023-09-26 16:36 Nik Bune
  2023-09-26 20:34 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Nik Bune @ 2023-09-26 16:36 UTC (permalink / raw)
  To: Andrew Morton, Greg Kroah-Hartman, skhan, Jakub Kicinski, Jens Axboe
  Cc: Nik Bune, linux-kernel

When run make htmldocs there is a warning appears
./include/linux/dcache.h:311: warning: expecting prototype for dget, dget_dlock(). Prototype was for dget_dlock() instead

The comment over the dget_dlock function describes both dget_dlock and dget functions. dget goes right after dget_dlock.

Removed "dget" from dget_dlock function comment.
Copied the same block to the dget function below.


Signed-off-by: Nik Bune <n2h9z4@gmail.com>
---
 include/linux/dcache.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 6b351e009f59..47adb8dda4a9 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -300,7 +300,7 @@ extern char *dentry_path(const struct dentry *, char *, int);
 /* Allocation counts.. */
 
 /**
- *	dget, dget_dlock -	get a reference to a dentry
+ *	dget_dlock -	get a reference to a dentry
  *	@dentry: dentry to get a reference to
  *
  *	Given a dentry or %NULL pointer increment the reference count
@@ -314,6 +314,14 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
 	return dentry;
 }
 
+/**
+ *	dget -	get a reference to a dentry
+ *	@dentry: dentry to get a reference to
+ *
+ *	Given a dentry or %NULL pointer increment the reference count
+ *	if appropriate and return the dentry. A dentry will not be 
+ *	destroyed when it has references.
+ */
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] include/linux/dcache.h: fix warning in doc comment
  2023-09-26 16:36 [PATCH] include/linux/dcache.h: fix warning in doc comment Nik Bune
@ 2023-09-26 20:34 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2023-09-26 20:34 UTC (permalink / raw)
  To: Nik Bune, Andrew Morton, Greg Kroah-Hartman, skhan,
	Jakub Kicinski, Jens Axboe, Alexander Viro, Christian Brauner
  Cc: linux-kernel

Hi,

[adding VFS folks]

On 9/26/23 09:36, Nik Bune wrote:
> When run make htmldocs there is a warning appears
> ./include/linux/dcache.h:311: warning: expecting prototype for dget, dget_dlock(). Prototype was for dget_dlock() instead
> 
> The comment over the dget_dlock function describes both dget_dlock and dget functions. dget goes right after dget_dlock.
> 
> Removed "dget" from dget_dlock function comment.
> Copied the same block to the dget function below.
> 
> 
> Signed-off-by: Nik Bune <n2h9z4@gmail.com>

I was working on this one also, but yours is good as far as it goes.

I was trying to differentiate between dget() and dget_dlock().
Something simple and short, like:

in get():

	dget() is used for the initial lockref on a dentry.

and in dget_dlock():

	dget_dlock() is used to increment the lockref count
	after the initial lockref is made.

but I don't know how correct those comments are or how they
should be improved.  :(

> ---
>  include/linux/dcache.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/dcache.h b/include/linux/dcache.h
> index 6b351e009f59..47adb8dda4a9 100644
> --- a/include/linux/dcache.h
> +++ b/include/linux/dcache.h
> @@ -300,7 +300,7 @@ extern char *dentry_path(const struct dentry *, char *, int);
>  /* Allocation counts.. */
>  
>  /**
> - *	dget, dget_dlock -	get a reference to a dentry
> + *	dget_dlock -	get a reference to a dentry
>   *	@dentry: dentry to get a reference to
>   *
>   *	Given a dentry or %NULL pointer increment the reference count
> @@ -314,6 +314,14 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
>  	return dentry;
>  }
>  
> +/**
> + *	dget -	get a reference to a dentry
> + *	@dentry: dentry to get a reference to
> + *
> + *	Given a dentry or %NULL pointer increment the reference count
> + *	if appropriate and return the dentry. A dentry will not be 
> + *	destroyed when it has references.
> + */
>  static inline struct dentry *dget(struct dentry *dentry)
>  {
>  	if (dentry)

-- 
~Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-26 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 16:36 [PATCH] include/linux/dcache.h: fix warning in doc comment Nik Bune
2023-09-26 20:34 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®