linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix return-value types in several function documentation comments
@ 2020-03-29 20:21 Josh Triplett
  2020-03-30  4:17 ` Ritesh Harjani
  2020-04-10  3:49 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Triplett @ 2020-03-29 20:21 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel

The documentation comments for ext4_read_block_bitmap_nowait and
ext4_read_inode_bitmap describe them as returning NULL on error, but
they return an ERR_PTR on error; update the documentation to match.

The documentation comment for ext4_wait_block_bitmap describes it as
returning 1 on error, but it returns -errno on error; update the
documentation to match.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
 fs/ext4/balloc.c | 4 ++--
 fs/ext4/ialloc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 8fd0b3cdab4c..9a296008cf90 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -410,7 +410,7 @@ static int ext4_validate_block_bitmap(struct super_block *sb,
  * Read the bitmap for a given block_group,and validate the
  * bits for block/inode/inode tables are set in the bitmaps
  *
- * Return buffer_head on success or NULL in case of failure.
+ * Return buffer_head on success or an ERR_PTR in case of failure.
  */
 struct buffer_head *
 ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)
@@ -502,7 +502,7 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)
 	return ERR_PTR(err);
 }
 
-/* Returns 0 on success, 1 on error */
+/* Returns 0 on success, -errno on error */
 int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group,
 			   struct buffer_head *bh)
 {
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index f95ee99091e4..86a96dca9ebf 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -113,7 +113,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb,
  * Read the inode allocation bitmap for a given block_group, reading
  * into the specified slot in the superblock's bitmap cache.
  *
- * Return buffer_head of bitmap on success or NULL.
+ * Return buffer_head of bitmap on success, or an ERR_PTR on error.
  */
 static struct buffer_head *
 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
-- 
2.26.0


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

* Re: [PATCH] ext4: Fix return-value types in several function documentation comments
  2020-03-29 20:21 [PATCH] ext4: Fix return-value types in several function documentation comments Josh Triplett
@ 2020-03-30  4:17 ` Ritesh Harjani
  2020-04-10  3:49 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2020-03-30  4:17 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel



On 3/30/20 1:51 AM, Josh Triplett wrote:
> The documentation comments for ext4_read_block_bitmap_nowait and
> ext4_read_inode_bitmap describe them as returning NULL on error, but
> they return an ERR_PTR on error; update the documentation to match.
> 
> The documentation comment for ext4_wait_block_bitmap describes it as
> returning 1 on error, but it returns -errno on error; update the
> documentation to match.
> 
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>

Thanks for your patch.
Reviewed-by: Ritesh Harani <riteshh@linux.ibm.com>


Just a note for next time:-
"Update the documentation to match" - could be misleading.
As 'Documentation' is generally referred as info inside Documentation/
directory in kernel. We could just say as-
"Update the function comment description"


> ---
>   fs/ext4/balloc.c | 4 ++--
>   fs/ext4/ialloc.c | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
> index 8fd0b3cdab4c..9a296008cf90 100644
> --- a/fs/ext4/balloc.c
> +++ b/fs/ext4/balloc.c
> @@ -410,7 +410,7 @@ static int ext4_validate_block_bitmap(struct super_block *sb,
>    * Read the bitmap for a given block_group,and validate the
>    * bits for block/inode/inode tables are set in the bitmaps
>    *
> - * Return buffer_head on success or NULL in case of failure.
> + * Return buffer_head on success or an ERR_PTR in case of failure.
>    */
>   struct buffer_head *
>   ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)
> @@ -502,7 +502,7 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)
>   	return ERR_PTR(err);
>   }
> 
> -/* Returns 0 on success, 1 on error */
> +/* Returns 0 on success, -errno on error */
>   int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group,
>   			   struct buffer_head *bh)
>   {
> diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
> index f95ee99091e4..86a96dca9ebf 100644
> --- a/fs/ext4/ialloc.c
> +++ b/fs/ext4/ialloc.c
> @@ -113,7 +113,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb,
>    * Read the inode allocation bitmap for a given block_group, reading
>    * into the specified slot in the superblock's bitmap cache.
>    *
> - * Return buffer_head of bitmap on success or NULL.
> + * Return buffer_head of bitmap on success, or an ERR_PTR on error.
>    */
>   static struct buffer_head *
>   ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
> 


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

* Re: [PATCH] ext4: Fix return-value types in several function documentation comments
  2020-03-29 20:21 [PATCH] ext4: Fix return-value types in several function documentation comments Josh Triplett
  2020-03-30  4:17 ` Ritesh Harjani
@ 2020-04-10  3:49 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-04-10  3:49 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Andreas Dilger, linux-ext4, linux-kernel

On Sun, Mar 29, 2020 at 01:21:41PM -0700, Josh Triplett wrote:
> The documentation comments for ext4_read_block_bitmap_nowait and
> ext4_read_inode_bitmap describe them as returning NULL on error, but
> they return an ERR_PTR on error; update the documentation to match.
> 
> The documentation comment for ext4_wait_block_bitmap describes it as
> returning 1 on error, but it returns -errno on error; update the
> documentation to match.
> 
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>

Applied, thanks.

					- Ted

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

end of thread, other threads:[~2020-04-10  3:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 20:21 [PATCH] ext4: Fix return-value types in several function documentation comments Josh Triplett
2020-03-30  4:17 ` Ritesh Harjani
2020-04-10  3:49 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).