diff mbox series

[*-next,01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()

Message ID 20250221-rmv_return-v1-1-cc8dff275827@quicinc.com (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series Remove weird and needless 'return' for void APIs | expand

Commit Message

Zijun Hu Feb. 21, 2025, 1:02 p.m. UTC
Remove needless 'return' in void API tlb_remove_page() since both the
API and tlb_remove_page_size() are void functions.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 include/asm-generic/tlb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Zijlstra Feb. 21, 2025, 8:01 p.m. UTC | #1
On Fri, Feb 21, 2025 at 05:02:06AM -0800, Zijun Hu wrote:
> Remove needless 'return' in void API tlb_remove_page() since both the
> API and tlb_remove_page_size() are void functions.
> 
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
>  include/asm-generic/tlb.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
> index e402aef79c93..812110813b84 100644
> --- a/include/asm-generic/tlb.h
> +++ b/include/asm-generic/tlb.h
> @@ -501,7 +501,7 @@ static __always_inline bool __tlb_remove_page(struct mmu_gather *tlb,
>   */
>  static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>  {
> -	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
> +	tlb_remove_page_size(tlb, page, PAGE_SIZE);
>  }

So I don't mind removing it, but note that that return enforces
tlb_remove_page_size() has void return type.

It might not be your preferred coding style, but it is not completely
pointless.
diff mbox series

Patch

diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index e402aef79c93..812110813b84 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -501,7 +501,7 @@  static __always_inline bool __tlb_remove_page(struct mmu_gather *tlb,
  */
 static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 {
-	return tlb_remove_page_size(tlb, page, PAGE_SIZE);
+	tlb_remove_page_size(tlb, page, PAGE_SIZE);
 }
 
 static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)