selftests dma: fix compile error for dma_map_benchmark
authorYu Liao <liaoyu15@huawei.com>
Tue, 14 Jun 2022 12:02:35 +0000 (20:02 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 16 Jun 2022 20:03:21 +0000 (14:03 -0600)
When building selftests/dma:
$ make -C tools/testing/selftests TARGETS=dma
I hit the following compilation error:

dma_map_benchmark.c:13:10: fatal error: linux/map_benchmark.h: No such file or directory
 #include <linux/map_benchmark.h>
          ^~~~~~~~~~~~~~~~~~~~~~~

dma/Makefile does not include the map_benchmark.h path, so add
more including path, and fix include order in dma_map_benchmark.c

Fixes: 8ddde07a3d28 ("dma-mapping: benchmark: extract a common header file for map_benchmark definition")
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/dma/Makefile
tools/testing/selftests/dma/dma_map_benchmark.c

index aa8e8b5b3864e7a09045b6636ff7ec8f2187f45c..cd8c5ece1cba4f24dfd4af7f0cd10f413e3828ef 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS += -I../../../../usr/include/
+CFLAGS += -I../../../../include/
 
 TEST_GEN_PROGS := dma_map_benchmark
 
index c3b3c09e995e80e95d79d6bf6f5ec10ef93898d0..5c997f17fcbdb0d183519b7291d1f41159ea6c08 100644 (file)
@@ -10,8 +10,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <linux/map_benchmark.h>
 #include <linux/types.h>
+#include <linux/map_benchmark.h>
 
 #define NSEC_PER_MSEC  1000000L