Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/testing/nvdimm: Fix compilation failure without CONFIG_DEV_DAX_PMEM_COMPAT

When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
compilation of tools/testing/nvdimm fails with:

Building modules, stage 2.
MODPOST 11 modules
ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!

Fix the problem by calling dax_pmem_compat_test() only if the kernel has
the required functionality.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200123154720.12097-1-jack@suse.cz
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Jan Kara and committed by
Dan Williams
c0e71d60 b9bd8039

+2
+2
tools/testing/nvdimm/test/nfit.c
··· 3164 3164 mcsafe_test(); 3165 3165 dax_pmem_test(); 3166 3166 dax_pmem_core_test(); 3167 + #ifdef CONFIG_DEV_DAX_PMEM_COMPAT 3167 3168 dax_pmem_compat_test(); 3169 + #endif 3168 3170 3169 3171 nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); 3170 3172