2023-06-28 02:02:36

by Lu Hongfei

[permalink] [raw]
Subject: [PATCH v2] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc

The return value type of i_blocksize() is 'unsigned int', so the
type of blocksize has been modified from 'int' to 'unsigned int'
to ensure data type consistency.

Signed-off-by: Lu Hongfei <[email protected]>
---
The modifications made compared to the previous version are as follows:
1. Keep the alignment of the variable names.

fs/iomap/buffered-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index a4fa81af60d9..37e3daeffc0a 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1076,7 +1076,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
{
loff_t start_byte;
loff_t end_byte;
- int blocksize = i_blocksize(inode);
+ unsigned int blocksize = i_blocksize(inode);

if (iomap->type != IOMAP_DELALLOC)
return 0;
--
2.39.0



2023-06-28 02:46:53

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH v2] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc

On 6/27/23 18:58, Lu Hongfei wrote:
> The return value type of i_blocksize() is 'unsigned int', so the
> type of blocksize has been modified from 'int' to 'unsigned int'
> to ensure data type consistency.
>
> Signed-off-by: Lu Hongfei <[email protected]>
> ---
>

Looks good.

Reviewed-by: Chaitanya Kulkarni <[email protected]>

-ck


2023-06-28 17:58:29

by Darrick J. Wong

[permalink] [raw]
Subject: Re: [PATCH v2] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc

On Wed, Jun 28, 2023 at 09:58:03AM +0800, Lu Hongfei wrote:
> The return value type of i_blocksize() is 'unsigned int', so the
> type of blocksize has been modified from 'int' to 'unsigned int'
> to ensure data type consistency.
>
> Signed-off-by: Lu Hongfei <[email protected]>

Looks ok,
Reviewed-by: Darrick J. Wong <[email protected]>

--D

> ---
> The modifications made compared to the previous version are as follows:
> 1. Keep the alignment of the variable names.
>
> fs/iomap/buffered-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index a4fa81af60d9..37e3daeffc0a 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -1076,7 +1076,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
> {
> loff_t start_byte;
> loff_t end_byte;
> - int blocksize = i_blocksize(inode);
> + unsigned int blocksize = i_blocksize(inode);
>
> if (iomap->type != IOMAP_DELALLOC)
> return 0;
> --
> 2.39.0
>