linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests dma: fix compile error for dma_map_benchmark
@ 2022-06-14 12:02 Yu Liao
  2022-06-16 20:05 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Liao @ 2022-06-14 12:02 UTC (permalink / raw)
  To: chenxiang66, song.bao.hua, tiantao6, shuah
  Cc: liaoyu15, liwei391, linux-kernel, linux-kselftest

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>
---
 tools/testing/selftests/dma/Makefile            | 1 +
 tools/testing/selftests/dma/dma_map_benchmark.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/dma/Makefile b/tools/testing/selftests/dma/Makefile
index aa8e8b5b3864..cd8c5ece1cba 100644
--- a/tools/testing/selftests/dma/Makefile
+++ b/tools/testing/selftests/dma/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS += -I../../../../usr/include/
+CFLAGS += -I../../../../include/
 
 TEST_GEN_PROGS := dma_map_benchmark
 
diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/testing/selftests/dma/dma_map_benchmark.c
index c3b3c09e995e..5c997f17fcbd 100644
--- a/tools/testing/selftests/dma/dma_map_benchmark.c
+++ b/tools/testing/selftests/dma/dma_map_benchmark.c
@@ -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
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests dma: fix compile error for dma_map_benchmark
  2022-06-14 12:02 [PATCH] selftests dma: fix compile error for dma_map_benchmark Yu Liao
@ 2022-06-16 20:05 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2022-06-16 20:05 UTC (permalink / raw)
  To: Yu Liao, chenxiang66, song.bao.hua, tiantao6, shuah
  Cc: liwei391, linux-kernel, linux-kselftest, Shuah Khan

On 6/14/22 6:02 AM, Yu Liao wrote:
> 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>
> ---
>   tools/testing/selftests/dma/Makefile            | 1 +
>   tools/testing/selftests/dma/dma_map_benchmark.c | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/dma/Makefile b/tools/testing/selftests/dma/Makefile
> index aa8e8b5b3864..cd8c5ece1cba 100644
> --- a/tools/testing/selftests/dma/Makefile
> +++ b/tools/testing/selftests/dma/Makefile
> @@ -1,5 +1,6 @@
>   # SPDX-License-Identifier: GPL-2.0
>   CFLAGS += -I../../../../usr/include/
> +CFLAGS += -I../../../../include/
>   
>   TEST_GEN_PROGS := dma_map_benchmark
>   
> diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/testing/selftests/dma/dma_map_benchmark.c
> index c3b3c09e995e..5c997f17fcbd 100644
> --- a/tools/testing/selftests/dma/dma_map_benchmark.c
> +++ b/tools/testing/selftests/dma/dma_map_benchmark.c
> @@ -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
>   
> 

Thank you for the fix. Applied to linux-kselftest fixes branch for
Linux 5.19-rc3 or rc4

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-16 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 12:02 [PATCH] selftests dma: fix compile error for dma_map_benchmark Yu Liao
2022-06-16 20:05 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).