linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: remove redundant if overhead
@ 2024-09-10 14:39 Zhiguo Jiang
  2024-09-10 16:03 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Zhiguo Jiang @ 2024-09-10 14:39 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle),
	Andrew Morton, linux-fsdevel, linux-mm, linux-kernel
  Cc: opensource.kernel, Zhiguo Jiang

Remove redundant if judgment overhead.

Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
 mm/page-writeback.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index fcd4c1439cb9..2d2c3f4e640d
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2715,9 +2715,7 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
  */
 bool noop_dirty_folio(struct address_space *mapping, struct folio *folio)
 {
-	if (!folio_test_dirty(folio))
-		return !folio_test_set_dirty(folio);
-	return false;
+	return !folio_test_set_dirty(folio);
 }
 EXPORT_SYMBOL(noop_dirty_folio);
 
-- 
2.39.0



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

end of thread, other threads:[~2024-09-11  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 14:39 [PATCH] mm: remove redundant if overhead Zhiguo Jiang
2024-09-10 16:03 ` Matthew Wilcox
2024-09-11  1:14   ` zhiguojiang
2024-09-11  1:34     ` Matthew Wilcox

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