Skip to contentSkip to conversation

selftests: gpio: fix include path to kernel headers for out of tree builds

PATCH Applied Kent Gibson 2 participants 2 messages Jul 19, 2022 – Jul 20, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: gpio: fix include path to kernel headers for out of tree builds

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

---

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(-)
tools/testing/selftests/gpio/Makefile +1 -1
index 71b306602368..616ed4019655 100644
@@ -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
Signature · 1 line
2.37.1
#1 lore raw
Quoted 34 lines · Kent Gibson

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

---

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(-)
tools/testing/selftests/gpio/Makefile +1 -2
index 71b306602368..616ed4019655 100644
@@ -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
--
Quoted 2 lines

2.37.1

Queued for fixes, thanks!

Bart