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

Hongfu Li posted 1 patch 1 week ago
mm/folio-compat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by Hongfu Li 1 week ago
From: Hongfu Li <lihongfu@kylinos.cn>

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.

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
 mm/folio-compat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/folio-compat.c b/mm/folio-compat.c
index a02179a0bded..8eb3e7fe4c91 100644
--- a/mm/folio-compat.c
+++ b/mm/folio-compat.c
@@ -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);
 
-- 
2.54.0
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by Matthew Wilcox 1 week ago
On Fri, Jul 17, 2026 at 03:20:54PM +0800, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
> 
> 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.
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by Hongfu Li 5 days, 3 hours ago
> > From: Hongfu Li <lihongfu@kylinos.cn>
> > 
> > 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.

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
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by David Hildenbrand (Arm) 4 days, 21 hours ago
On 7/20/26 02:37, Hongfu Li wrote:
>>> From: Hongfu Li <lihongfu@kylinos.cn>
>>>
>>> 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.
> 
> 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.

-- 
Cheers,

David
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by Lorenzo Stoakes (ARM) 1 week ago
On Fri, Jul 17, 2026 at 03:20:54PM +0800, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> 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.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>

LGTM so:

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

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

> ---
>  mm/folio-compat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/folio-compat.c b/mm/folio-compat.c
> index a02179a0bded..8eb3e7fe4c91 100644
> --- a/mm/folio-compat.c
> +++ b/mm/folio-compat.c
> @@ -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);
>
> --
> 2.54.0
>

Thanks, Lorenzo
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by Hongfu Li 1 week ago
> > From: Hongfu Li <lihongfu@kylinos.cn>
> >
> > 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.
> >
> > Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> 
> LGTM so:
> 
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> 
> 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
Re: [PATCH] mm/folio-compat: Drop superfluous return statements in void compat wrappers
Posted by David Hildenbrand (Arm) 1 week ago
On 7/17/26 10:42, Lorenzo Stoakes (ARM) wrote:
> On Fri, Jul 17, 2026 at 03:20:54PM +0800, Hongfu Li wrote:
>> From: Hongfu Li <lihongfu@kylinos.cn>
>>
>> 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.
>>
>> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> 
> LGTM so:
> 
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> 
> I would ask that you maybe slow down on the flow of patches lately :) review is
> pretty overwhelmed atm.

Exactly.

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David