linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fix selftests compiling errors and warnings
@ 2018-07-02  3:53 Li Zhijian
  2018-07-02  3:53 ` [PATCH 1/3] selftests/android: fix compiling error Li Zhijian
  2018-07-10  8:38 ` [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
  0 siblings, 2 replies; 9+ messages in thread
From: Li Zhijian @ 2018-07-02  3:53 UTC (permalink / raw)
  To: linux-kselftest, linux-kernel, shuah; +Cc: Li Zhijian


Li Zhijian (3):
  selftests/android: fix compiling error
  selftests/android: initialize heap_type to avoid compiling warning
  selftests/gpio: unset OUTPUT for build tools/gpio

 tools/testing/selftests/android/ion/Makefile        | 5 ++++-
 tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
 tools/testing/selftests/gpio/Makefile               | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

-- 
2.7.4


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

* [PATCH 1/3] selftests/android: fix compiling error
  2018-07-02  3:53 [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
@ 2018-07-02  3:53 ` Li Zhijian
  2018-07-02  3:53   ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Li Zhijian
  2018-07-10  8:38 ` [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
  1 sibling, 1 reply; 9+ messages in thread
From: Li Zhijian @ 2018-07-02  3:53 UTC (permalink / raw)
  To: linux-kselftest, linux-kernel, shuah; +Cc: Li Zhijian, Pintu Agarwal

lizhijian@haswell-OptiPlex-9020:/home/lizj/linux/tools/testing/selftests/android/ion$ make
gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionapp_export.c ipcsocket.c ionutils.c   -o ionapp_export
gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionapp_import.c ipcsocket.c ionutils.c   -o ionapp_import
gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionmap_test.c ipcsocket.c ionutils.c   -o ionmap_test
ionmap_test.c:12:27: fatal error: linux/dma-buf.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'ionmap_test' failed
make: *** [ionmap_test] Error 1

It requires headers_install to $TOP/usr

CC: Shuah Khan <shuah@kernel.org>
CC: Pintu Agarwal <pintu.ping@gmail.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/testing/selftests/android/ion/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile
index e036952..9f83299 100644
--- a/tools/testing/selftests/android/ion/Makefile
+++ b/tools/testing/selftests/android/ion/Makefile
@@ -4,7 +4,10 @@ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
 
 TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
 
-all: $(TEST_GEN_FILES)
+all: ../../../../../usr/include/linux/dma-buf.h $(TEST_GEN_FILES)
+
+../../../../../usr/include/linux/dma-buf.h:
+	make -C ../../../../../ headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../../usr
 
 $(TEST_GEN_FILES): ipcsocket.c ionutils.c
 
-- 
2.7.4


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

* [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning
  2018-07-02  3:53 ` [PATCH 1/3] selftests/android: fix compiling error Li Zhijian
@ 2018-07-02  3:53   ` Li Zhijian
  2018-07-02  3:53     ` [PATCH 3/3] selftests/gpio: unset OUTPUT for build tools/gpio Li Zhijian
  2018-07-10 14:50     ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Shuah Khan
  0 siblings, 2 replies; 9+ messages in thread
From: Li Zhijian @ 2018-07-02  3:53 UTC (permalink / raw)
  To: linux-kselftest, linux-kernel, shuah; +Cc: Li Zhijian, Pintu Agarwal

root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# make
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/root/linux-v4.18-rc2/tools/testing/selftests/android/ion'
gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionapp_export.c ipcsocket.c ionutils.c   -o ionapp_export
ionapp_export.c: In function 'main':
ionapp_export.c:91:2: warning: 'heap_type' may be used uninitialized in
this function [-Wmaybe-uninitialized]
  printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CC: Shuah Khan <shuah@kernel.org>
CC: Pintu Agarwal <pintu.ping@gmail.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/android/ion/ionapp_export.c b/tools/testing/selftests/android/ion/ionapp_export.c
index a944e72..e3435c2 100644
--- a/tools/testing/selftests/android/ion/ionapp_export.c
+++ b/tools/testing/selftests/android/ion/ionapp_export.c
@@ -49,6 +49,7 @@ int main(int argc, char *argv[])
 		return -1;
 	}
 
+	heap_type = -1UL;
 	heap_size = 0;
 	flags = 0;
 
@@ -82,6 +83,12 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (heap_type == -1UL) {
+		printf("heap_type is invalid\n");
+		print_usage(argc, argv);
+		exit(1);
+	}
+
 	if (heap_size <= 0) {
 		printf("heap_size cannot be 0\n");
 		print_usage(argc, argv);
-- 
2.7.4


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

* [PATCH 3/3] selftests/gpio: unset OUTPUT for build tools/gpio
  2018-07-02  3:53   ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Li Zhijian
@ 2018-07-02  3:53     ` Li Zhijian
  2018-07-10 14:50     ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Shuah Khan
  1 sibling, 0 replies; 9+ messages in thread
From: Li Zhijian @ 2018-07-02  3:53 UTC (permalink / raw)
  To: linux-kselftest, linux-kernel, shuah
  Cc: Li Zhijian, Bamvor Jian Zhang, Bartosz Golaszewski, linux-gpio

when we execute 'make' to build selftests, the TOP Makefile build gpio like:
selftests$ make ARCH= CROSS_COMPILE= OUTPUT=/home/lizj/linux/tools/testing/selftests/gpio -C gpio
...
make[2]: Leaving directory '/home/lizj/linux/tools/gpio'
gcc -O2 -g -std=gnu99 -Wall -I../../../../usr/include/gpio-mockup-chardev.c ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h  -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -lmount -o gpio-mockup-chardev
gcc: error: ../../../gpio/gpio-utils.o: No such file or directory
<builtin>: recipe for target 'gpio-mockup-chardev' failed
make[1]: *** [gpio-mockup-chardev] Error 1
make[1]: Leaving directory
'/home/lizj/linux/tools/testing/selftests/gpio'
Makefile:84: recipe for target 'all' failed
make: *** [all] Error 2

CC: Bamvor Jian Zhang <bamv2005@gmail.com>
CC: Bartosz Golaszewski <brgl@bgdev.pl>
CC: Shuah Khan <shuah@kernel.org>
CC: linux-gpio@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.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 1bbb475..e64a11c 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -24,7 +24,7 @@ LDLIBS += -lmount -I/usr/include/libmount
 $(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h
 
 ../../../gpio/gpio-utils.o:
-	make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
+	make OUTPUT= ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
 
 ../../../../usr/include/linux/gpio.h:
 	make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/
-- 
2.7.4


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

* Re: [PATCH 0/3] fix selftests compiling errors and warnings
  2018-07-02  3:53 [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
  2018-07-02  3:53 ` [PATCH 1/3] selftests/android: fix compiling error Li Zhijian
@ 2018-07-10  8:38 ` Li Zhijian
  2018-07-10 14:08   ` Shuah Khan
  1 sibling, 1 reply; 9+ messages in thread
From: Li Zhijian @ 2018-07-10  8:38 UTC (permalink / raw)
  To: linux-kselftest, linux-kernel, shuah

ping


On 07/02/2018 11:53 AM, Li Zhijian wrote:
> Li Zhijian (3):
>    selftests/android: fix compiling error
>    selftests/android: initialize heap_type to avoid compiling warning
>    selftests/gpio: unset OUTPUT for build tools/gpio
>
>   tools/testing/selftests/android/ion/Makefile        | 5 ++++-
>   tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
>   tools/testing/selftests/gpio/Makefile               | 2 +-
>   3 files changed, 12 insertions(+), 2 deletions(-)
>



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

* Re: [PATCH 0/3] fix selftests compiling errors and warnings
  2018-07-10  8:38 ` [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
@ 2018-07-10 14:08   ` Shuah Khan
  2018-07-11  1:37     ` Li Zhijian
  0 siblings, 1 reply; 9+ messages in thread
From: Shuah Khan @ 2018-07-10 14:08 UTC (permalink / raw)
  To: Li Zhijian, linux-kselftest, linux-kernel, anders.roxell, Shuah Khan

On 07/10/2018 02:38 AM, Li Zhijian wrote:
> ping
> 
> 
> On 07/02/2018 11:53 AM, Li Zhijian wrote:
>> Li Zhijian (3):
>>    selftests/android: fix compiling error
>>    selftests/android: initialize heap_type to avoid compiling warning
>>    selftests/gpio: unset OUTPUT for build tools/gpio
>>
>>   tools/testing/selftests/android/ion/Makefile        | 5 ++++-
>>   tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
>>   tools/testing/selftests/gpio/Makefile               | 2 +-
>>   3 files changed, 12 insertions(+), 2 deletions(-)
>>
> 
> 
> 

I was away on vacation all of last week. I will review the series.
Anders Roxell is working on making the change at the main Makefile
level to handle the headers dependency. I have been waiting to hear
from Maintainers to Ack it.

Once Anders patch goes in, is the first and third patches in this series
needed?

No problems with the second one. I can get that in soon.

thanks,
-- Shuah

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

* Re: [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning
  2018-07-02  3:53   ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Li Zhijian
  2018-07-02  3:53     ` [PATCH 3/3] selftests/gpio: unset OUTPUT for build tools/gpio Li Zhijian
@ 2018-07-10 14:50     ` Shuah Khan
  2018-07-10 17:16       ` Pintu Kumar
  1 sibling, 1 reply; 9+ messages in thread
From: Shuah Khan @ 2018-07-10 14:50 UTC (permalink / raw)
  To: Li Zhijian, linux-kselftest, linux-kernel; +Cc: Pintu Agarwal, Shuah Khan

Hi Li Zhijian,

On 07/01/2018 09:53 PM, Li Zhijian wrote:
> root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# make
> make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> make[1]: Entering directory '/root/linux-v4.18-rc2/tools/testing/selftests/android/ion'
> gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionapp_export.c ipcsocket.c ionutils.c   -o ionapp_export
> ionapp_export.c: In function 'main':
> ionapp_export.c:91:2: warning: 'heap_type' may be used uninitialized in
> this function [-Wmaybe-uninitialized]
>   printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> CC: Shuah Khan <shuah@kernel.org>
> CC: Pintu Agarwal <pintu.ping@gmail.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
>  tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tools/testing/selftests/android/ion/ionapp_export.c b/tools/testing/selftests/android/ion/ionapp_export.c
> index a944e72..e3435c2 100644
> --- a/tools/testing/selftests/android/ion/ionapp_export.c
> +++ b/tools/testing/selftests/android/ion/ionapp_export.c
> @@ -49,6 +49,7 @@ int main(int argc, char *argv[])
>  		return -1;
>  	}
>  
> +	heap_type = -1UL;

Initialize it to one of the valid types. ION_HEAP_TYPE_SYSTEM
is one choice.


>  	heap_size = 0;
>  	flags = 0;
>  
> @@ -82,6 +83,12 @@ int main(int argc, char *argv[])
>  		}
>  	}
>  
> +	if (heap_type == -1UL) {
> +		printf("heap_type is invalid\n");
> +		print_usage(argc, argv);
> +		exit(1);
> +	}

This check isn't necessary. The test requires two arguments,
-i <heap id> and -s <size in bytes> and won't run without either
one of them. heap_type is going to be ION_HEAP_TYPE_SYSTEM or
ION_HEAP_TYPE_SYSTEM_CONTIG at this point.

Interesting. Looks like this test doesn't cover all ion_heap_types.

thanks,
-- Shuah

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

* Re: [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning
  2018-07-10 14:50     ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Shuah Khan
@ 2018-07-10 17:16       ` Pintu Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Pintu Kumar @ 2018-07-10 17:16 UTC (permalink / raw)
  To: Shuah Khan; +Cc: lizhijian, linux-kselftest, open list

On Tue, Jul 10, 2018 at 8:20 PM Shuah Khan <shuah@kernel.org> wrote:
>
> Hi Li Zhijian,
>
> On 07/01/2018 09:53 PM, Li Zhijian wrote:
> > root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# make
> > make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
> > make[1]: Entering directory '/root/linux-v4.18-rc2/tools/testing/selftests/android/ion'
> > gcc  -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/ -Wall -O2 -g    ionapp_export.c ipcsocket.c ionutils.c   -o ionapp_export
> > ionapp_export.c: In function 'main':
> > ionapp_export.c:91:2: warning: 'heap_type' may be used uninitialized in
> > this function [-Wmaybe-uninitialized]
> >   printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size);
> >   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > CC: Shuah Khan <shuah@kernel.org>
> > CC: Pintu Agarwal <pintu.ping@gmail.com>
> > Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> > ---
> >  tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/tools/testing/selftests/android/ion/ionapp_export.c b/tools/testing/selftests/android/ion/ionapp_export.c
> > index a944e72..e3435c2 100644
> > --- a/tools/testing/selftests/android/ion/ionapp_export.c
> > +++ b/tools/testing/selftests/android/ion/ionapp_export.c
> > @@ -49,6 +49,7 @@ int main(int argc, char *argv[])
> >               return -1;
> >       }
> >
> > +     heap_type = -1UL;
>
> Initialize it to one of the valid types. ION_HEAP_TYPE_SYSTEM
> is one choice.
>
Yes, the test requires at least one of the heap type.
If you want, you can set it to the default value (0) at the
initialization time and not -1.

>
> >       heap_size = 0;
> >       flags = 0;
> >
May be we can set the heap_type as 0 here, to avoid those
uninitialized warnings.

> > @@ -82,6 +83,12 @@ int main(int argc, char *argv[])
> >               }
> >       }
> >
> > +     if (heap_type == -1UL) {
> > +             printf("heap_type is invalid\n");
> > +             print_usage(argc, argv);
> > +             exit(1);
> > +     }
>
> This check isn't necessary. The test requires two arguments,
> -i <heap id> and -s <size in bytes> and won't run without either
> one of them. heap_type is going to be ION_HEAP_TYPE_SYSTEM or
> ION_HEAP_TYPE_SYSTEM_CONTIG at this point.
>
> Interesting. Looks like this test doesn't cover all ion_heap_types.
>
Yes, all heap_types were not supported. As per Laura's request I removed it.
Other heap_types actually requires explicit declaration of reserved
memory or CMA region.

If you require other heap_type support then may be you can look into
my github version:
https://github.com/pintuk/LINUX/tree/master/android/ion


> thanks,
> -- Shuah

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

* Re: [PATCH 0/3] fix selftests compiling errors and warnings
  2018-07-10 14:08   ` Shuah Khan
@ 2018-07-11  1:37     ` Li Zhijian
  0 siblings, 0 replies; 9+ messages in thread
From: Li Zhijian @ 2018-07-11  1:37 UTC (permalink / raw)
  To: Shuah Khan, linux-kselftest, linux-kernel, anders.roxell



On 07/10/2018 10:08 PM, Shuah Khan wrote:
> On 07/10/2018 02:38 AM, Li Zhijian wrote:
>> ping
>>
>>
>> On 07/02/2018 11:53 AM, Li Zhijian wrote:
>>> Li Zhijian (3):
>>>     selftests/android: fix compiling error
>>>     selftests/android: initialize heap_type to avoid compiling warning
>>>     selftests/gpio: unset OUTPUT for build tools/gpio
>>>
>>>    tools/testing/selftests/android/ion/Makefile        | 5 ++++-
>>>    tools/testing/selftests/android/ion/ionapp_export.c | 7 +++++++
>>>    tools/testing/selftests/gpio/Makefile               | 2 +-
>>>    3 files changed, 12 insertions(+), 2 deletions(-)
>>>
>>
>>
> I was away on vacation all of last week. I will review the series.
> Anders Roxell is working on making the change at the main Makefile
> level to handle the headers dependency.

Good to know this, looking forward it


>   I have been waiting to hear
> from Maintainers to Ack it.
>
> Once Anders patch goes in, is the first and third patches in this series
> needed?

I will have a check once his patch is merged


Thanks

>
> No problems with the second one. I can get that in soon.
>
> thanks,
> -- Shuah
>
>
> .
>



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

end of thread, other threads:[~2018-07-11  1:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02  3:53 [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
2018-07-02  3:53 ` [PATCH 1/3] selftests/android: fix compiling error Li Zhijian
2018-07-02  3:53   ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Li Zhijian
2018-07-02  3:53     ` [PATCH 3/3] selftests/gpio: unset OUTPUT for build tools/gpio Li Zhijian
2018-07-10 14:50     ` [PATCH 2/3] selftests/android: initialize heap_type to avoid compiling warning Shuah Khan
2018-07-10 17:16       ` Pintu Kumar
2018-07-10  8:38 ` [PATCH 0/3] fix selftests compiling errors and warnings Li Zhijian
2018-07-10 14:08   ` Shuah Khan
2018-07-11  1:37     ` Li Zhijian

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