diff options
| author | Usama Arif <usamaarif642@gmail.com> | 2025-08-15 14:54:57 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-09-13 16:55:06 -0700 |
| commit | 49850bd02658181f235e3f3fd0a9884f812f0914 (patch) | |
| tree | a3a7fd9b91dc62ab8b087469cadbba86406307e2 /tools/testing/selftests/mm/vm_util.h | |
| parent | 7de854910bcb7aca917223caf9feec23035d4c26 (diff) | |
selftest/mm: extract sz2ord function into vm_util.h
The function already has 2 uses and will have a 3rd one in prctl
selftests. The pagesize argument is added into the function, as it's not
a global variable anymore. No functional change intended with this patch.
Link: https://lkml.kernel.org/r/20250815135549.130506-6-usamaarif642@gmail.com
Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Usama Arif <usamaarif642@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jann Horn <jannh@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yafang <laoar.shao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/mm/vm_util.h')
| -rw-r--r-- | tools/testing/selftests/mm/vm_util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 85f7dae9a0c1..3da56feeb944 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -127,9 +127,9 @@ static inline void log_test_result(int result) ksft_test_result_report(result, "%s\n", test_name); } -static inline int sz2ord(size_t size) +static inline int sz2ord(size_t size, size_t pagesize) { - return __builtin_ctzll(size / getpagesize()); + return __builtin_ctzll(size / pagesize); } void *sys_mremap(void *old_address, unsigned long old_size, |
