2017-09-18 12:02:00

by Colin King

[permalink] [raw]
Subject: [PATCH] xfs: remove redundant re-initialization of total_nr_pages

From: Colin Ian King <[email protected]>

Variable total_nr_pages is being initialized and then updated with
the same value, this latter assignment is redundant and can be
removed. Cleans up clang build warning:

Value stored to 'total_nr_pages' during its initialization is never read

Signed-off-by: Colin Ian King <[email protected]>
---
fs/xfs/xfs_buf.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index da14658da310..2f97c12ca75e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1258,8 +1258,6 @@ xfs_buf_ioapply_map(
int size;
int offset;

- total_nr_pages = bp->b_page_count;
-
/* skip the pages in the buffer before the start offset */
page_index = 0;
offset = *buf_offset;
--
2.14.1


2017-09-18 12:44:54

by Brian Foster

[permalink] [raw]
Subject: Re: [PATCH] xfs: remove redundant re-initialization of total_nr_pages

On Mon, Sep 18, 2017 at 01:01:57PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> Variable total_nr_pages is being initialized and then updated with
> the same value, this latter assignment is redundant and can be
> removed. Cleans up clang build warning:
>
> Value stored to 'total_nr_pages' during its initialization is never read
>
> Signed-off-by: Colin Ian King <[email protected]>
> ---

Reviewed-by: Brian Foster <[email protected]>

> fs/xfs/xfs_buf.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index da14658da310..2f97c12ca75e 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1258,8 +1258,6 @@ xfs_buf_ioapply_map(
> int size;
> int offset;
>
> - total_nr_pages = bp->b_page_count;
> -
> /* skip the pages in the buffer before the start offset */
> page_index = 0;
> offset = *buf_offset;
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2017-09-18 20:38:37

by Darrick J. Wong

[permalink] [raw]
Subject: Re: [PATCH] xfs: remove redundant re-initialization of total_nr_pages

On Mon, Sep 18, 2017 at 01:01:57PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> Variable total_nr_pages is being initialized and then updated with
> the same value, this latter assignment is redundant and can be
> removed. Cleans up clang build warning:
>
> Value stored to 'total_nr_pages' during its initialization is never read
>
> Signed-off-by: Colin Ian King <[email protected]>

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

> ---
> fs/xfs/xfs_buf.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index da14658da310..2f97c12ca75e 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1258,8 +1258,6 @@ xfs_buf_ioapply_map(
> int size;
> int offset;
>
> - total_nr_pages = bp->b_page_count;
> -
> /* skip the pages in the buffer before the start offset */
> page_index = 0;
> offset = *buf_offset;
> --
> 2.14.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html