Skip to contentSkip to conversation

nilfs2: remove redundant pointer sbufs

PATCH In review Colin Ian King 2 participants 2 messages Dec 11, 2021 – Dec 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs2: remove redundant pointer sbufs

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);
---
 fs/nilfs2/page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nilfs2/page.c +2 -2
index bc3e2cd4117f..063dd16d75b5 100644
@@ -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);
 
Signature · 1 line
2.33.1
maintainer
#1 lore raw
Quoted 11 lines · Colin Ian King

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);

Looks good.
Will apply, thank you.

Ryusuke Konishi

Quoted 26 lines
---
 fs/nilfs2/page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nilfs2/page.c +2 -3
index bc3e2cd4117f..063dd16d75b5 100644
@@ -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);
 
--

2.33.1