linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: gpio: fix include path to kernel headers for out of tree builds
@ 2022-07-19 11:06 Kent Gibson
  2022-07-20 12:35 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Kent Gibson @ 2022-07-19 11:06 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, brgl, linus.walleij
  Cc: Kent Gibson, kernel test robot

When building selftests out of the kernel tree the gpio.h the include
path is incorrect and the build falls back to the system includes
which may be outdated.

Add the KHDR_INCLUDES to the CFLAGS to include the gpio.h from the
build tree.

Fixes: 4f4d0af7b2d9 ("selftests: gpio: restore CFLAGS options")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
---

The test bot suggested
4f4d0af7b2d9 ("selftests: gpio: restore CFLAGS options")
as the commit to be fixed, but the previous fix which turned out to be
incomplete seems more appropriate.

 tools/testing/selftests/gpio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 71b306602368..616ed4019655 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -3,6 +3,6 @@
 TEST_PROGS := gpio-mockup.sh gpio-sim.sh
 TEST_FILES := gpio-mockup-sysfs.sh
 TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev gpio-chip-info gpio-line-name
-CFLAGS += -O2 -g -Wall -I../../../../usr/include/
+CFLAGS += -O2 -g -Wall -I../../../../usr/include/ $(KHDR_INCLUDES)
 
 include ../lib.mk
-- 
2.37.1


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

* Re: [PATCH] selftests: gpio: fix include path to kernel headers for out of tree builds
  2022-07-19 11:06 [PATCH] selftests: gpio: fix include path to kernel headers for out of tree builds Kent Gibson
@ 2022-07-20 12:35 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2022-07-20 12:35 UTC (permalink / raw)
  To: Kent Gibson
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Linus Walleij, kernel test robot

On Tue, Jul 19, 2022 at 1:06 PM Kent Gibson <warthog618@gmail.com> wrote:
>
> When building selftests out of the kernel tree the gpio.h the include
> path is incorrect and the build falls back to the system includes
> which may be outdated.
>
> Add the KHDR_INCLUDES to the CFLAGS to include the gpio.h from the
> build tree.
>
> Fixes: 4f4d0af7b2d9 ("selftests: gpio: restore CFLAGS options")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Kent Gibson <warthog618@gmail.com>
> ---
>
> The test bot suggested
> 4f4d0af7b2d9 ("selftests: gpio: restore CFLAGS options")
> as the commit to be fixed, but the previous fix which turned out to be
> incomplete seems more appropriate.
>
>  tools/testing/selftests/gpio/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
> index 71b306602368..616ed4019655 100644
> --- a/tools/testing/selftests/gpio/Makefile
> +++ b/tools/testing/selftests/gpio/Makefile
> @@ -3,6 +3,6 @@
>  TEST_PROGS := gpio-mockup.sh gpio-sim.sh
>  TEST_FILES := gpio-mockup-sysfs.sh
>  TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev gpio-chip-info gpio-line-name
> -CFLAGS += -O2 -g -Wall -I../../../../usr/include/
> +CFLAGS += -O2 -g -Wall -I../../../../usr/include/ $(KHDR_INCLUDES)
>
>  include ../lib.mk
> --
> 2.37.1
>

Queued for fixes, thanks!

Bart

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

end of thread, other threads:[~2022-07-20 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19 11:06 [PATCH] selftests: gpio: fix include path to kernel headers for out of tree builds Kent Gibson
2022-07-20 12:35 ` Bartosz Golaszewski

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).