2021-12-28 17:28:04

by Ryusuke Konishi

[permalink] [raw]
Subject: [PATCH] nilfs2: remove redundant pointer sbufs

From: Colin Ian King <[email protected]>

Pointer sbufs is being assigned a value but it's not being used
later on. The pointer is redundant and can be removed. Cleans up
scan-build static analysis warning:

fs/nilfs2/page.c:203:8: warning: Although the value stored to 'sbufs'
is used in the enclosing expression, the value is never actually read
from 'sbufs' [deadcode.DeadStores]
sbh = sbufs = page_buffers(src);

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
---
fs/nilfs2/page.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c
index bc3e2cd4117f..063dd16d75b5 100644
--- a/fs/nilfs2/page.c
+++ b/fs/nilfs2/page.c
@@ -195,12 +195,12 @@ void nilfs_page_bug(struct page *page)
*/
static void nilfs_copy_page(struct page *dst, struct page *src, int copy_dirty)
{
- struct buffer_head *dbh, *dbufs, *sbh, *sbufs;
+ struct buffer_head *dbh, *dbufs, *sbh;
unsigned long mask = NILFS_BUFFER_INHERENT_BITS;

BUG_ON(PageWriteback(dst));

- sbh = sbufs = page_buffers(src);
+ sbh = page_buffers(src);
if (!page_has_buffers(dst))
create_empty_buffers(dst, sbh->b_size, 0);

--
1.8.3.1



2021-12-28 17:38:09

by Ryusuke Konishi

[permalink] [raw]
Subject: Re: [PATCH] nilfs2: remove redundant pointer sbufs

Hi Andrew,

Please queue this for the next merge window.

Thank you,
Ryusuke Konishi

On Wed, Dec 29, 2021 at 2:27 AM Ryusuke Konishi
<[email protected]> wrote:
>
> From: Colin Ian King <[email protected]>
>
> Pointer sbufs is being assigned a value but it's not being used
> later on. The pointer is redundant and can be removed. Cleans up
> scan-build static analysis warning:
>
> fs/nilfs2/page.c:203:8: warning: Although the value stored to 'sbufs'
> is used in the enclosing expression, the value is never actually read
> from 'sbufs' [deadcode.DeadStores]
> sbh = sbufs = page_buffers(src);
>
> Link: https://lkml.kernel.org/r/[email protected]
> Signed-off-by: Colin Ian King <[email protected]>
> Signed-off-by: Ryusuke Konishi <[email protected]>
> ---
> fs/nilfs2/page.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c
> index bc3e2cd4117f..063dd16d75b5 100644
> --- a/fs/nilfs2/page.c
> +++ b/fs/nilfs2/page.c
> @@ -195,12 +195,12 @@ void nilfs_page_bug(struct page *page)
> */
> static void nilfs_copy_page(struct page *dst, struct page *src, int copy_dirty)
> {
> - struct buffer_head *dbh, *dbufs, *sbh, *sbufs;
> + struct buffer_head *dbh, *dbufs, *sbh;
> unsigned long mask = NILFS_BUFFER_INHERENT_BITS;
>
> BUG_ON(PageWriteback(dst));
>
> - sbh = sbufs = page_buffers(src);
> + sbh = page_buffers(src);
> if (!page_has_buffers(dst))
> create_empty_buffers(dst, sbh->b_size, 0);
>
> --
> 1.8.3.1
>