Re: [PATCH v6 2/6] tools/lib/mm: add shared file helpers

Mike Rapoport <[email protected]> Mon, 03 Aug 2026 12:00:01 +0300
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <178574760161.1561566.15822401997260524037.b4-review@b4>
> Move read_file(), write_file(), read_num(), and write_num() out of
> tools/testing/selftests/mm/vm_util.c into a new shared helper under
> tools/lib/mm/.
> 
> @@ -187,8 +188,8 @@ TEST_FILES += write_hugetlb_memory.sh
>  
>  include ../lib.mk
>  
> -$(TEST_GEN_PROGS): vm_util.c hugepage_settings.c
> -$(TEST_GEN_FILES): vm_util.c hugepage_settings.c
> +$(TEST_GEN_PROGS): vm_util.c hugepage_settings.c $(top_srcdir)/tools/lib/mm/file_utils.c
> +$(TEST_GEN_FILES): vm_util.c hugepage_settings.c $(top_srcdir)/tools/lib/mm/file_utils.c

I was too lazy to change the Makefile, but we should do something to
compile those once and link to every TEST_PROG that uses them.

-- 
Sincerely yours,
Mike.