mirror of
https://github.com/torvalds/linux.git
synced 2025-11-30 23:16:01 +07:00
mm: clean up is_guard_pte_marker()
Let's simplify the implementation. The current code is redundant as it effectively expands to: is_swap_pte(pte) && is_pte_marker_entry(...) && // from is_pte_marker() is_pte_marker_entry(...) // from is_guard_swp_entry() While a modern compiler could likely optimize this away, let's have clean code and not rely on it. Link: https://lkml.kernel.org/r/20250924045830.3817-1-lance.yang@linux.dev Signed-off-by: Lance Yang <lance.yang@linux.dev> Reviewed-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Reviewed-by: Dev Jain <dev.jain@arm.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: Hugh Dickins <hughd@google.com> Cc: Kairui Song <kasong@tencent.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Mariano Pache <npache@redhat.com> Cc: Mika Penttilä <mpenttil@redhat.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
0a947c14e4
commit
89be2815f4
@@ -1071,8 +1071,8 @@ static bool is_valid_guard_vma(struct vm_area_struct *vma, bool allow_locked)
|
||||
|
||||
static bool is_guard_pte_marker(pte_t ptent)
|
||||
{
|
||||
return is_pte_marker(ptent) &&
|
||||
is_guard_swp_entry(pte_to_swp_entry(ptent));
|
||||
return is_swap_pte(ptent) &&
|
||||
is_guard_swp_entry(pte_to_swp_entry(ptent));
|
||||
}
|
||||
|
||||
static int guard_install_pud_entry(pud_t *pud, unsigned long addr,
|
||||
|
||||
Reference in New Issue
Block a user