linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] selftests: gpio: fix minor build issues
@ 2021-11-08  1:28 Kent Gibson
  2021-11-08  1:28 ` [PATCH 1/3] selftests: gpio: fix gpio compiling error Kent Gibson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kent Gibson @ 2021-11-08  1:28 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-kselftest, brgl, linus.walleij,
	shuah, bamv2005, lizhijian
  Cc: 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 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(-)

-- 
2.33.1


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

* [PATCH 1/3] selftests: gpio: fix gpio compiling error
  2021-11-08  1:28 [PATCH 0/3] selftests: gpio: fix minor build issues Kent Gibson
@ 2021-11-08  1:28 ` Kent Gibson
  2021-11-08  1:28 ` [PATCH 2/3] selftests: gpio: fix uninitialised variable warning Kent Gibson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kent Gibson @ 2021-11-08  1:28 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-kselftest, brgl, linus.walleij,
	shuah, bamv2005, lizhijian
  Cc: kernel test robot, Kent Gibson

From: Li Zhijian <lizhijian@cn.fujitsu.com>

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.

Fixes: 8bc395a6a2e2 ("selftests: gpio: rework and simplify test implementation")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
[Kent: reworded commit comment and added Fixes:]
Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/testing/selftests/gpio/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 39f2bbe8dd3d..42ea7d2aa844 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -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
-- 
2.33.1


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

* [PATCH 2/3] selftests: gpio: fix uninitialised variable warning
  2021-11-08  1:28 [PATCH 0/3] selftests: gpio: fix minor build issues Kent Gibson
  2021-11-08  1:28 ` [PATCH 1/3] selftests: gpio: fix gpio compiling error Kent Gibson
@ 2021-11-08  1:28 ` Kent Gibson
  2021-11-08  1:28 ` [PATCH 3/3] selftests: gpio: restore CFLAGS options Kent Gibson
  2021-11-15 13:28 ` [PATCH 0/3] selftests: gpio: fix minor build issues Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Kent Gibson @ 2021-11-08  1:28 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-kselftest, brgl, linus.walleij,
	shuah, bamv2005, lizhijian
  Cc: Kent Gibson

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

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/testing/selftests/gpio/gpio-mockup-cdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/gpio/gpio-mockup-cdev.c b/tools/testing/selftests/gpio/gpio-mockup-cdev.c
index e83eac71621a..d1640f44f8ac 100644
--- a/tools/testing/selftests/gpio/gpio-mockup-cdev.c
+++ b/tools/testing/selftests/gpio/gpio-mockup-cdev.c
@@ -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;
 
-- 
2.33.1


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

* [PATCH 3/3] selftests: gpio: restore CFLAGS options
  2021-11-08  1:28 [PATCH 0/3] selftests: gpio: fix minor build issues Kent Gibson
  2021-11-08  1:28 ` [PATCH 1/3] selftests: gpio: fix gpio compiling error Kent Gibson
  2021-11-08  1:28 ` [PATCH 2/3] selftests: gpio: fix uninitialised variable warning Kent Gibson
@ 2021-11-08  1:28 ` Kent Gibson
  2021-11-15 13:28 ` [PATCH 0/3] selftests: gpio: fix minor build issues Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Kent Gibson @ 2021-11-08  1:28 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-kselftest, brgl, linus.walleij,
	shuah, bamv2005, lizhijian
  Cc: Kent Gibson

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

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 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 42ea7d2aa844..d7b312b44a62 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -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
-- 
2.33.1


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

* Re: [PATCH 0/3] selftests: gpio: fix minor build issues
  2021-11-08  1:28 [PATCH 0/3] selftests: gpio: fix minor build issues Kent Gibson
                   ` (2 preceding siblings ...)
  2021-11-08  1:28 ` [PATCH 3/3] selftests: gpio: restore CFLAGS options Kent Gibson
@ 2021-11-15 13:28 ` Bartosz Golaszewski
  3 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2021-11-15 13:28 UTC (permalink / raw)
  To: Kent Gibson
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	linux-kselftest, Linus Walleij, Shuah Khan, Bamvor Jian Zhang,
	lizhijian

On Mon, Nov 8, 2021 at 2:29 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> 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(-)
>
> --
> 2.33.1
>

Queued for fixes, thanks!

Bart

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

end of thread, other threads:[~2021-11-15 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  1:28 [PATCH 0/3] selftests: gpio: fix minor build issues Kent Gibson
2021-11-08  1:28 ` [PATCH 1/3] selftests: gpio: fix gpio compiling error Kent Gibson
2021-11-08  1:28 ` [PATCH 2/3] selftests: gpio: fix uninitialised variable warning Kent Gibson
2021-11-08  1:28 ` [PATCH 3/3] selftests: gpio: restore CFLAGS options Kent Gibson
2021-11-15 13:28 ` [PATCH 0/3] selftests: gpio: fix minor build issues 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).