mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
selftests/mm: uffd-common: use kselftest framework
Update err() and errexit() to use ksft_print_msg() and ksft_exit_fail(). This is preparatory change required to update userfaulfd tests to use kselftest framework. Link: https://lore.kernel.org/20260511162840.375890-19-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Barry Song <baohua@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Donet Tom <donettom@linux.ibm.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Lance Yang <lance.yang@linux.dev> Cc: Leon Romanovsky <leon@kernel.org> Cc: Liam Howlett <liam@infradead.org> Cc: Li Wang <li.wang@linux.dev> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Luiz Capitulino <luizcap@redhat.com> Cc: Mark Brown <broonie@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Nico Pache <npache@redhat.com> Cc: Peter Xu <peterx@redhat.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Sarthak Sharma <sarthak.sharma@arm.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
04d0c0092b
commit
4cf3a2657b
|
|
@ -40,21 +40,20 @@
|
|||
|
||||
#define UFFD_FLAGS (O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY)
|
||||
|
||||
#define _err(fmt, ...) \
|
||||
do { \
|
||||
int ret = errno; \
|
||||
fprintf(stderr, "ERROR: " fmt, ##__VA_ARGS__); \
|
||||
fprintf(stderr, " (errno=%d, @%s:%d)\n", \
|
||||
ret, __FILE__, __LINE__); \
|
||||
#define _err(fmt, ...) \
|
||||
do { \
|
||||
int ret = errno; \
|
||||
ksft_print_msg("ERROR: " fmt " (errno=%d, @%s:%d)\n", \
|
||||
##__VA_ARGS__, ret, __FILE__, __LINE__); \
|
||||
} while (0)
|
||||
|
||||
#define errexit(exitcode, fmt, ...) \
|
||||
#define errexit(fmt, ...) \
|
||||
do { \
|
||||
_err(fmt, ##__VA_ARGS__); \
|
||||
exit(exitcode); \
|
||||
ksft_exit_fail(); \
|
||||
} while (0)
|
||||
|
||||
#define err(fmt, ...) errexit(1, fmt, ##__VA_ARGS__)
|
||||
#define err(fmt, ...) errexit(fmt, ##__VA_ARGS__)
|
||||
|
||||
struct uffd_global_test_opts {
|
||||
unsigned long nr_parallel, nr_pages, nr_pages_per_cpu, page_size;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user