From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757377AbcIVOY0 (ORCPT ); Thu, 22 Sep 2016 10:24:26 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35040 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756116AbcIVOYY (ORCPT ); Thu, 22 Sep 2016 10:24:24 -0400 Subject: Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework To: Michael Ellerman References: <20160921211205.22657-1-emilio.lopez@collabora.co.uk> <20160921211205.22657-2-emilio.lopez@collabora.co.uk> <87fuos8e25.fsf@concordia.ellerman.id.au> Cc: shuah@kernel.org, devel@driverdev.osuosl.org, gustavo.padovan@collabora.co.uk, riandrews@android.com, daniel.vetter@ffwll.ch, John.C.Harrison@Intel.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, ghackmann@google.com, robdclark@gmail.com, linux-kselftest@vger.kernel.org, maarten.lankhorst@linux.intel.com, daniels@collabora.com, arve@android.com, emil.l.velikov@gmail.com From: =?UTF-8?Q?Emilio_L=c3=b3pez?= Message-ID: <56f420ed-e985-2433-31fd-50515d8bcd1c@collabora.co.uk> Date: Thu, 22 Sep 2016 11:23:51 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <87fuos8e25.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, El 22/09/16 a las 06:43, Michael Ellerman escribió: > Emilio López writes: >> +CFLAGS += -I../../../../include/uapi/ > > Please don't include the unprocessed uapi headers, they are not meant to > be directly included in userspace programs. > > They even say so: > > include/uapi/linux/types.h:#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders" > >> +CFLAGS += -I../../../../include/ > > Please don't include the *kernel* headers, they're really not meant to > be used in userspace programs :) > >> +CFLAGS += -I../../../../usr/include/ > > That is the correct place to get them from. They'll have been put there > by 'make headers_install'. > >> +CFLAGS += -I../../../../drivers/dma-buf/ > > That's also a bit fishy. My inspiration here has been tools/testing/selftests/memfd/Makefile, which does it this way. If I only include the ones on usr then it doesn't build, as there's no sync_file.h available, even after running make headers_install. How am I supposed to use the ioctls from there? The dma-buf include path is a leftover from the previous version, there's no longer any headers there. I've fixed the other things you pointed out, the new Makefile is below if you want to take another look. Thanks for the review! :) Emilio --- CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra CFLAGS += -I../../../../usr/include/ LDFLAGS += -pthread TEST_PROGS = sync_test all: $(TEST_PROGS) include ../lib.mk OBJS = sync_test.o sync.o TESTS += sync_alloc.o TESTS += sync_fence.o TESTS += sync_merge.o TESTS += sync_wait.o TESTS += sync_stress_parallelism.o TESTS += sync_stress_consumer.o TESTS += sync_stress_merge.o sync_test: $(OBJS) $(TESTS) clean: $(RM) sync_test $(OBJS) $(TESTS)