Skip to content

Commit 6ef7571

Browse files
committed
mm-khugepaged-merge-pte-scanning-logic-into-a-new-helper-checkpatch-fixes
WARNING: else is not generally useful after a break or return torvalds#81: FILE: mm/khugepaged.c:574: + return PTE_CHECK_CONTINUE; + } else { WARNING: else is not generally useful after a break or return torvalds#110: FILE: mm/khugepaged.c:603: + return PTE_CHECK_CONTINUE; + } else { total: 0 errors, 2 warnings, 290 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/mm-khugepaged-merge-pte-scanning-logic-into-a-new-helper.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Baolin Wang <[email protected]> Cc: Barry Song <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Dev Jain <[email protected]> Cc: Lance Yang <[email protected]> Cc: Liam Howlett <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: Mariano Pache <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Wei Yang <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 5ce7714 commit 6ef7571

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mm/khugepaged.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,10 @@ static inline int thp_collapse_check_pte(pte_t pte, struct vm_area_struct *vma,
571571
(!cc->is_khugepaged ||
572572
*none_or_zero <= khugepaged_max_ptes_none)) {
573573
return PTE_CHECK_CONTINUE;
574-
} else {
575-
*scan_result = SCAN_EXCEED_NONE_PTE;
576-
count_vm_event(THP_SCAN_EXCEED_NONE_PTE);
577-
return PTE_CHECK_FAIL;
578574
}
575+
*scan_result = SCAN_EXCEED_NONE_PTE;
576+
count_vm_event(THP_SCAN_EXCEED_NONE_PTE);
577+
return PTE_CHECK_FAIL;
579578
} else if (!pte_present(pte)) {
580579
if (!unmapped) {
581580
*scan_result = SCAN_PTE_NON_PRESENT;
@@ -600,11 +599,10 @@ static inline int thp_collapse_check_pte(pte_t pte, struct vm_area_struct *vma,
600599
return PTE_CHECK_FAIL;
601600
}
602601
return PTE_CHECK_CONTINUE;
603-
} else {
604-
*scan_result = SCAN_EXCEED_SWAP_PTE;
605-
count_vm_event(THP_SCAN_EXCEED_SWAP_PTE);
606-
return PTE_CHECK_FAIL;
607602
}
603+
*scan_result = SCAN_EXCEED_SWAP_PTE;
604+
count_vm_event(THP_SCAN_EXCEED_SWAP_PTE);
605+
return PTE_CHECK_FAIL;
608606
} else if (pte_uffd_wp(pte)) {
609607
/*
610608
* Don't collapse the page if any of the small PTEs are

0 commit comments

Comments
 (0)