]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm: change to return bool for ptep_test_and_clear_young()
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Sat, 21 Mar 2026 06:42:49 +0000 (14:42 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:35 +0000 (13:53 -0700)
commita62ca3f40feaaaf0dfc4db1f2edeca5a70f4123d
tree4cd7340e8a6ac1c21e0c6d83a476b6b361f6f66e
parentf2a48f8fb56466488f7525e3349d4e2f45dc5d74
mm: change to return bool for ptep_test_and_clear_young()

Patch series "change young flag check functions to return bool", v2.

This is a cleanup patchset to change all young flag check functions to
return bool, as discussed with David in the previous thread[1].  Since
callers only care about whether the young flag was set, returning bool
makes the intention clearer.  No functional changes intended.

This patch (of 6):

Callers use ptep_test_and_clear_young() to clear the young flag and check
whether it was set.  Change the return type to bool to make the intention
clearer.

Link: https://lkml.kernel.org/r/cover.1774075004.git.baolin.wang@linux.alibaba.com
Link: https://lkml.kernel.org/r/57e70efa9703d43959aa645246ea3cbdba14fa17.1774075004.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
14 files changed:
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/contpte.c
arch/microblaze/include/asm/pgtable.h
arch/parisc/include/asm/pgtable.h
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/nohash/pgtable.h
arch/riscv/include/asm/pgtable.h
arch/riscv/mm/pgtable.c
arch/s390/include/asm/pgtable.h
arch/x86/include/asm/pgtable.h
arch/x86/mm/pgtable.c
arch/xtensa/include/asm/pgtable.h
include/linux/pgtable.h