Skip to contentSkip to conversation

mm/folio-compat: Drop superfluous return statements in void compat wrappers

PATCH In review Hongfu Li 4 participants 7 messages Jul 17 – Jul 20

Subsystems (2)
lore
Share & tools
lore

Hongfu Li

author
#0 lore raw

PATCH 1/1 mm/folio-compat: Drop superfluous return statements in void compat wrappers

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

---
 mm/folio-compat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/folio-compat.c +3 -3
index a02179a0bded..8eb3e7fe4c91 100644
@@ -13,19 +13,19 @@
 
 void unlock_page(struct page *page)
 {
-	return folio_unlock(page_folio(page));
+	folio_unlock(page_folio(page));
 }
 EXPORT_SYMBOL(unlock_page);
 
 void end_page_writeback(struct page *page)
 {
-	return folio_end_writeback(page_folio(page));
+	folio_end_writeback(page_folio(page));
 }
 EXPORT_SYMBOL(end_page_writeback);
 
 void wait_on_page_writeback(struct page *page)
 {
-	return folio_wait_writeback(page_folio(page));
+	folio_wait_writeback(page_folio(page));
 }
 EXPORT_SYMBOL_GPL(wait_on_page_writeback);
 
Signature · 1 line
2.54.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hongfu Li

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

LGTM so:

I would ask that you maybe slow down on the flow of patches lately :) review is pretty overwhelmed atm.

Quoted 32 lines
---
 mm/folio-compat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/folio-compat.c +3 -4
index a02179a0bded..8eb3e7fe4c91 100644
@@ -13,19 +13,19 @@
 
 void unlock_page(struct page *page)
 {
-	return folio_unlock(page_folio(page));
+	folio_unlock(page_folio(page));
 }
 EXPORT_SYMBOL(unlock_page);
 
 void end_page_writeback(struct page *page)
 {
-	return folio_end_writeback(page_folio(page));
+	folio_end_writeback(page_folio(page));
 }
 EXPORT_SYMBOL(end_page_writeback);
 
 void wait_on_page_writeback(struct page *page)
 {
-	return folio_wait_writeback(page_folio(page));
+	folio_wait_writeback(page_folio(page));
 }
 EXPORT_SYMBOL_GPL(wait_on_page_writeback);
 
--
Quoted 2 lines

2.54.0

Thanks, Lorenzo

maintainer Acked-by
#2 lore raw
Quoted 11 lines · Lorenzo Stoakes (ARM)
Quoted 10 lines · Hongfu Li

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

Quoted 8 lines
Quoted 1 line

LGTM so:

I would ask that you maybe slow down on the flow of patches lately :) review is pretty overwhelmed atm.

Exactly.

Signature · 3 lines
Cheers,

David
author
#3 lore raw
In reply to Lorenzo Stoakes (ARM)
Quoted 10 lines
Quoted 10 lines

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

Quoted 8 lines
Quoted 1 line

LGTM so:

I would ask that you maybe slow down on the flow of patches lately :) review is pretty overwhelmed atm.

Sorry about the heavy patch stream recently.
I'll space out my patch submissions to reduce review pressure. Really appreciate your time and careful review.

Best regards,
Hongfu

#4 lore raw
In reply to Hongfu Li
Quoted 9 lines · Hongfu Li

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

why bother? this file is temporary scaffolding. if they offend you so much, work on removing the need for them.

author
#5 lore raw
Quoted 8 lines
Quoted 8 lines

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Quoted 4 lines
Quoted 1 line

Drop all these superfluous return keywords.

why bother? this file is temporary scaffolding. if they offend you so much, work on removing the need for them.

Thanks a lot for your comments.

I fully agree with your point. You've already made great progress cleaning up this temporary scaffolding. I will follow your lead and keep working on reducing usages of these helper functions.

Best regards,
Hongfu

#6 lore raw
Quoted 10 lines · Hongfu Li
Quoted 10 lines
Quoted 9 lines

From: Hongfu Li <[email protected]>

unlock_page(), end_page_writeback() and wait_on_page_writeback() are void wrappers forwarding to folio-based functions which also return void. Explicit return statements here are syntactically valid but unnecessary, and inconsistent with other nearby compat helpers such as mark_page_accessed() and set_page_writeback().

Drop all these superfluous return keywords.

Quoted 8 lines
Quoted 2 lines

why bother? this file is temporary scaffolding. if they offend you so much, work on removing the need for them.

Thanks a lot for your comments.

I fully agree with your point. You've already made great progress cleaning up this temporary scaffolding. I will follow your lead and keep working on reducing usages of these helper functions.

As much as I agree, this patch here is perfectly fine.

Signature · 3 lines
Cheers,

David