mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] nilfs2 minor amendments
@ 2022-09-21  3:48 Ryusuke Konishi
  2022-09-21  3:48 ` [PATCH 1/2] nilfs2: delete unnecessary checks before brelse() Ryusuke Konishi
  2022-09-21  3:48 ` [PATCH 2/2] nilfs2: Remove the unneeded result variable Ryusuke Konishi
  0 siblings, 2 replies; 3+ messages in thread
From: Ryusuke Konishi @ 2022-09-21  3:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-nilfs, LKML

Hi Andrew,

please queue the following changes for the next merge window.
Both are minor coding-level fixes by users of a robot reporter.

Minghao Chi (1):
  nilfs2: delete unnecessary checks before brelse()

ye xingchen (1):
  nilfs2: Remove the unneeded result variable


Thanks,
Ryusuke Konishi
--
 fs/nilfs2/btree.c   | 6 ++----
 fs/nilfs2/segment.c | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)

-- 
2.34.1


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

* [PATCH 1/2] nilfs2: delete unnecessary checks before brelse()
  2022-09-21  3:48 [PATCH 0/2] nilfs2 minor amendments Ryusuke Konishi
@ 2022-09-21  3:48 ` Ryusuke Konishi
  2022-09-21  3:48 ` [PATCH 2/2] nilfs2: Remove the unneeded result variable Ryusuke Konishi
  1 sibling, 0 replies; 3+ messages in thread
From: Ryusuke Konishi @ 2022-09-21  3:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-nilfs, LKML

From: Minghao Chi <chi.minghao@zte.com.cn>

The brelse() inline function tests whether its argument is NULL
and then returns immediately.
Thus remove the tests which are not needed around the shown calls.

Link: https://lkml.kernel.org/r/20220819081700.96279-1-chi.minghao@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
---
 fs/nilfs2/btree.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 9f4d9432d38a..b9d15c3df3cc 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -1668,8 +1668,7 @@ static int nilfs_btree_check_delete(struct nilfs_bmap *btree, __u64 key)
 	maxkey = nilfs_btree_node_get_key(node, nchildren - 1);
 	nextmaxkey = (nchildren > 1) ?
 		nilfs_btree_node_get_key(node, nchildren - 2) : 0;
-	if (bh != NULL)
-		brelse(bh);
+	brelse(bh);
 
 	return (maxkey == key) && (nextmaxkey < NILFS_BMAP_LARGE_LOW);
 }
@@ -1717,8 +1716,7 @@ static int nilfs_btree_gather_data(struct nilfs_bmap *btree,
 		ptrs[i] = le64_to_cpu(dptrs[i]);
 	}
 
-	if (bh != NULL)
-		brelse(bh);
+	brelse(bh);
 
 	return nitems;
 }
-- 
2.34.1


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

* [PATCH 2/2] nilfs2: Remove the unneeded result variable
  2022-09-21  3:48 [PATCH 0/2] nilfs2 minor amendments Ryusuke Konishi
  2022-09-21  3:48 ` [PATCH 1/2] nilfs2: delete unnecessary checks before brelse() Ryusuke Konishi
@ 2022-09-21  3:48 ` Ryusuke Konishi
  1 sibling, 0 replies; 3+ messages in thread
From: Ryusuke Konishi @ 2022-09-21  3:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-nilfs, LKML

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value nilfs_segctor_sync() directly instead of storing it in
another redundant variable.

Link: https://lkml.kernel.org/r/20220831033403.302184-1-ye.xingchen@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
---
 fs/nilfs2/segment.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 0afe0832c754..9abae2c9120e 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -2235,7 +2235,6 @@ int nilfs_construct_segment(struct super_block *sb)
 	struct the_nilfs *nilfs = sb->s_fs_info;
 	struct nilfs_sc_info *sci = nilfs->ns_writer;
 	struct nilfs_transaction_info *ti;
-	int err;
 
 	if (!sci)
 		return -EROFS;
@@ -2243,8 +2242,7 @@ int nilfs_construct_segment(struct super_block *sb)
 	/* A call inside transactions causes a deadlock. */
 	BUG_ON((ti = current->journal_info) && ti->ti_magic == NILFS_TI_MAGIC);
 
-	err = nilfs_segctor_sync(sci);
-	return err;
+	return nilfs_segctor_sync(sci);
 }
 
 /**
-- 
2.34.1


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

end of thread, other threads:[~2022-09-21  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21  3:48 [PATCH 0/2] nilfs2 minor amendments Ryusuke Konishi
2022-09-21  3:48 ` [PATCH 1/2] nilfs2: delete unnecessary checks before brelse() Ryusuke Konishi
2022-09-21  3:48 ` [PATCH 2/2] nilfs2: Remove the unneeded result variable Ryusuke Konishi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®