linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Remove redundant return in set_huge_zero_folio()
@ 2025-03-06 14:43 Dev Jain
  2025-03-06 15:34 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Dev Jain @ 2025-03-06 14:43 UTC (permalink / raw)
  To: akpm, linux-mm, linux-kernel; +Cc: ryan.roberts, david, willy, Dev Jain

It is the responsibility of the caller to check pmd_none(); in any case,
we are not achieving anything by returning since there is no return value
to tell the caller that we succeeded or not. So remove this check.

Signed-off-by: Dev Jain <dev.jain@arm.com>
---
 mm/huge_memory.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 3d3ebdc002d5..f64212d674fd 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1309,8 +1309,6 @@ static void set_huge_zero_folio(pgtable_t pgtable, struct mm_struct *mm,
 		struct folio *zero_folio)
 {
 	pmd_t entry;
-	if (!pmd_none(*pmd))
-		return;
 	entry = mk_pmd(&zero_folio->page, vma->vm_page_prot);
 	entry = pmd_mkhuge(entry);
 	pgtable_trans_huge_deposit(mm, pmd, pgtable);
-- 
2.30.2



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

* Re: [PATCH] mm: Remove redundant return in set_huge_zero_folio()
  2025-03-06 14:43 [PATCH] mm: Remove redundant return in set_huge_zero_folio() Dev Jain
@ 2025-03-06 15:34 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2025-03-06 15:34 UTC (permalink / raw)
  To: Dev Jain, akpm, linux-mm, linux-kernel; +Cc: ryan.roberts, willy

On 06.03.25 15:43, Dev Jain wrote:
> It is the responsibility of the caller to check pmd_none(); in any case,
> we are not achieving anything by returning since there is no return value
> to tell the caller that we succeeded or not. So remove this check.
> 
> Signed-off-by: Dev Jain <dev.jain@arm.com>
> ---
>   mm/huge_memory.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 3d3ebdc002d5..f64212d674fd 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -1309,8 +1309,6 @@ static void set_huge_zero_folio(pgtable_t pgtable, struct mm_struct *mm,
>   		struct folio *zero_folio)
>   {
>   	pmd_t entry;
> -	if (!pmd_none(*pmd))
> -		return;
>   	entry = mk_pmd(&zero_folio->page, vma->vm_page_prot);
>   	entry = pmd_mkhuge(entry);
>   	pgtable_trans_huge_deposit(mm, pmd, pgtable);

Reviewed-by: David Hildenbrand <david@redhat.com>


-- 
Cheers,

David / dhildenb



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

end of thread, other threads:[~2025-03-06 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-06 14:43 [PATCH] mm: Remove redundant return in set_huge_zero_folio() Dev Jain
2025-03-06 15:34 ` David Hildenbrand

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