Re: [PATCH V5 1/2] selftests: vm: bring common functions to a new file

From: David Hildenbrand
Date: Mon Mar 21 2022 - 12:10:30 EST


> diff --git a/tools/testing/selftests/vm/vm_util.h b/tools/testing/selftests/vm/vm_util.h
> new file mode 100644
> index 0000000000000..e9f5a0f2be196
> --- /dev/null
> +++ b/tools/testing/selftests/vm/vm_util.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#include <stdint.h>
> +#include <fcntl.h>
> +#include "../kselftest.h"

Are that latter two really required in this header? IMHO they should be
moved to the respective files that need them.

If you return "bool" below, you might want to include <stdbool.h> here
as well.

> +
> +uint64_t pagemap_get_entry(int fd, char *start);
> +bool pagemap_is_softdirty(int fd, char *start);
> +void clear_softdirty(void);
> +uint64_t read_pmd_pagesize(void);
> +uint64_t check_huge(void *addr);

Apart from that, LGTM.

--
Thanks,

David / dhildenb