selftests: gpio: fix minor build issues
Subsystems (3)
cover selftests: gpio: fix minor build issues
This is a series of fixes for minor problems in the building of the GPIO selftests introduced by my rework of those tests.
The first patch is from Li Zhijian and fixes a compiler error when building the selftests in environments with stale system includes. I have reworded the commit comment to make it more to the point in describing the root cause of the problem and the fix, as suggested by Shuah in his initial review of that patch.
The second patch fixes a warning when the tests are compiled with -Wall, and the final patch restores the CFLAGS that should not have been removed in the rework, including the -Wall.
Kent Gibson (2):
selftests: gpio: fix uninitialised variable warning
selftests: gpio: restore CFLAGS options
Li Zhijian (1):
selftests: gpio: fix gpio compiling error
tools/testing/selftests/gpio/Makefile | 1 + tools/testing/selftests/gpio/gpio-mockup-cdev.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.33.1
PATCH 1/3 selftests: gpio: fix gpio compiling error
From: Li Zhijian <[email protected]>
The gpio selftests build against the system includes rather than the headers from the linux tree. This results in the compile failing if the system includes are outdated.
Prefer the headers from the linux tree, as per other selftests.
--- tools/testing/selftests/gpio/Makefile | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/gpio/Makefile +1 -0
@@ -3,5 +3,6 @@ TEST_PROGS := gpio-mockup.sh TEST_FILES := gpio-mockup-sysfs.sh TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev +CFLAGS += -I../../../../usr/include include ../lib.mk
Signature · 1 line
2.33.1
PATCH 2/3 selftests: gpio: fix uninitialised variable warning
In reply to Kent GibsonWhen compiled with -Wall gpio-mockup-cdev.c reports an uninitialised variable warning. This is a false positive, as the variable is ignored in the case it is uninitialised, but initialise the variable anyway to remove the warning.
--- tools/testing/selftests/gpio/gpio-mockup-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/gpio/gpio-mockup-cdev.c +1 -1
@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) {char *chip;int opt, ret, cfd, lfd; -unsigned int offset, val, abiv; +unsigned int offset, val =0 , abiv;uint32_t flags_v1;uint64_t flags_v2;
Signature · 1 line
2.33.1
PATCH 3/3 selftests: gpio: restore CFLAGS options
In reply to Kent GibsonAll the CFLAGS options were incorrectly removed in the recent rework of the GPIO selftests. While some of the flags were specific to the old implementation the remainder are still relevant. Restore those options.
--- tools/testing/selftests/gpio/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/gpio/Makefile +1 -1
@@ -3,6 +3,6 @@ TEST_PROGS := gpio-mockup.sh TEST_FILES := gpio-mockup-sysfs.sh TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev -CFLAGS += -I../../../../usr/include +CFLAGS += -O2 -g -Wall -I../../../../usr/include/ include ../lib.mk
Signature · 1 line
2.33.1
Bartosz Golaszewski
AppliedQuoted 21 lines · Kent Gibson
This is a series of fixes for minor problems in the building of the GPIO selftests introduced by my rework of those tests.
The first patch is from Li Zhijian and fixes a compiler error when building the selftests in environments with stale system includes. I have reworded the commit comment to make it more to the point in describing the root cause of the problem and the fix, as suggested by Shuah in his initial review of that patch.
The second patch fixes a warning when the tests are compiled with -Wall, and the final patch restores the CFLAGS that should not have been removed in the rework, including the -Wall.
Kent Gibson (2):
selftests: gpio: fix uninitialised variable warning
selftests: gpio: restore CFLAGS optionsLi Zhijian (1):
selftests: gpio: fix gpio compiling error
Quoted 7 lines
tools/testing/selftests/gpio/Makefile | 1 + tools/testing/selftests/gpio/gpio-mockup-cdev.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)--
2.33.1
Queued for fixes, thanks!
Bart