Message ID | 20250306144315.21907-1-dev.jain@arm.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: Remove redundant return in set_huge_zero_folio() | expand |
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>
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);
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(-)