[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaMYdc4WLcLFMKd3MyyKnQpdhP3Wxkx6YPoR+0YmH8ifw@mail.gmail.com>
Date: Fri, 1 Oct 2021 00:39:42 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Li Zhijian <lizhijian@...fujitsu.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: Shuah Khan <shuah@...nel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
linux-kselftest@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
Philip Li <philip.li@...el.com>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] selftests/gpio: Fix gpio compiling error
Hi Li,
thanks for your patch!
It needs to be sent directly to Bartosz Golaszewski so he can apply
it to the GPIO tree.
Thanks!
Linus Walleij
On Fri, Sep 3, 2021 at 3:18 AM Li Zhijian <lizhijian@...fujitsu.com> wrote:
>
> [root@...s-rpma gpio]# make
> gcc gpio-mockup-cdev.c -o /home/lizhijian/linux/tools/testing/selftests/gpio/gpio-mockup-cdev
> gpio-mockup-cdev.c: In function ‘request_line_v2’:
> gpio-mockup-cdev.c:24:30: error: storage size of ‘req’ isn’t known
> 24 | struct gpio_v2_line_request req;
> | ^~~
> gpio-mockup-cdev.c:32:14: error: ‘GPIO_V2_LINE_FLAG_OUTPUT’ undeclared (first use in this function); did you mean ‘GPIOLINE_FLAG_IS_OUT’?
> 32 | if (flags & GPIO_V2_LINE_FLAG_OUTPUT) {
> | ^~~~~~~~~~~~~~~~~~~~~~~~
>
> gpio-mockup-cdev.c includes <linux/gpio.h> which could be provided by
> kernel-headers package, and where it's expected to declare
> GPIO_V2_LINE_FLAG_OUTPUT. However distros or developers will not always
> install the same kernel-header as we are compiling.
>
> So we can tell compiler to search headers from linux tree simply like others,
> such as sched.
>
> CC: Philip Li <philip.li@...el.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Li Zhijian <lizhijian@...fujitsu.com>
>
> ---
> V2: add more details about the fix
> ---
> 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.31.1
>
>
>
Powered by blists - more mailing lists