From patchwork Tue Dec 23 21:13:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 5535541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B0E4BEEA8 for ; Tue, 23 Dec 2014 21:17:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2684B20120 for ; Tue, 23 Dec 2014 21:17:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41EDA20108 for ; Tue, 23 Dec 2014 21:17:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y3Wnn-0005Iu-6r; Tue, 23 Dec 2014 21:15:35 +0000 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y3Wn2-0003w7-Sy for linux-arm-kernel@lists.infradead.org; Tue, 23 Dec 2014 21:14:50 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 777E2844D2; Wed, 24 Dec 2014 10:14:27 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1419369267; bh=KUc2TmOwXjdaMloTmj97KCHTmNisD0P5edw9Oi/qY2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pXu1v1Y/VDkINi2ZyaZrDf6RjCVk/r5LxPj9N2MxQCdFVlRyiOCeVOwYkNwNDr3OY 1StTWMoZkA6PhvnODz+Mxze6YswGMuo1H1rhqx8IW6+t13Dc2I9zGKjCepAQylDMGl HdzQ/5gKke27J+ozvtAScqEhQzOxi2v1ROwCnbX4= Received: from alliedtelesyn.co.nz (Not Verified[10.32.16.32]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 3, 0, 7277) id ; Wed, 24 Dec 2014 10:14:24 +1300 Received: from MAIL/SpoolDir by alliedtelesyn.co.nz (Mercury 1.48); 24 Dec 14 10:15:02 +1300 Received: from SpoolDir by MAIL (Mercury 1.48); 24 Dec 14 10:14:41 +1300 Received: from chrisp-dl.ws.atlnz.lc (10.33.22.30) by alliedtelesyn.co.nz (Mercury 1.48) with ESMTP; 24 Dec 14 10:14:37 +1300 Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 9B01780DF8; Wed, 24 Dec 2014 10:13:57 +1300 (NZDT) From: Chris Packham To: linux-arm-kernel@lists.infradead.org Subject: [RFC/PATCHv2 1/5] dtc: Use quotes to include header files Date: Wed, 24 Dec 2014 10:13:28 +1300 Message-Id: <1419369212-17047-2-git-send-email-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.2.0.rc0 In-Reply-To: <1419369212-17047-1-git-send-email-chris.packham@alliedtelesis.co.nz> References: <1419369212-17047-1-git-send-email-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141223_131449_377481_275F61D8 X-CRM114-Status: GOOD ( 12.09 ) X-Spam-Score: -0.1 (/) Cc: Andrew Lunn , Jason Cooper , Boris Brezillon , Chris Packham , Ezequiel Garcia , Gregory Clement , Maxime Ripard , Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently in arch and driver code that needs early access to the flattened device tree it is necessary to add specific CFLAGS so that when scripts/dtc/libfdt/libfdt.h is included the C preprocessor is able to locate the libfdt versions of libfdt_env.h and fdt.h without generating an error. We already provide an alternative linux-specific version of libfdt_env.h and directly include scripts/dtc/libfdt/fdt.h so the inclusion by scripts/dtc/libfdt/libfdt.h is a no-op thanks to the inclusion guards. By using quotes in scripts/dtc/libfdt/libfdt.h it picks up fdt.h and libfdt_env.h from the source directory without needing to add CFLAGS for the sources that happen to include linux/libfdt.h. Signed-off-by: Chris Packham --- For the files that include linux/libfdt.h we currently also have to specify additional CFLAGS to satisfy the CPP. $ git grep '' arch/mips/cavium-octeon/octeon-platform.c:#include arch/mips/cavium-octeon/setup.c:#include arch/mips/mti-sead3/sead3-setup.c:#include arch/powerpc/kernel/prom.c:#include drivers/firmware/efi/libstub/fdt.c:#include drivers/of/fdt.c:#include drivers/of/fdt_address.c:#include $ git grep -e '-I.*dtc/libfdt' arch/mips/cavium-octeon/Makefile:CFLAGS_octeon-platform.o = -I$(src)/../../../scripts/dtc/libfdt arch/mips/cavium-octeon/Makefile:CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt arch/mips/mti-sead3/Makefile:CFLAGS_sead3-setup.o = -I$(src)/../../../scripts/dtc/libfdt arch/powerpc/kernel/Makefile:CFLAGS_prom.o = -I$(src)/../../../scripts/dtc/libfdt drivers/firmware/efi/libstub/Makefile:CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/ drivers/of/Makefile:CFLAGS_fdt.o = -I$(src)/../../scripts/dtc/libfdt drivers/of/Makefile:CFLAGS_fdt_address.o = -I$(src)/../../scripts/dtc/libfdt lib/Makefile: $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt)) Simply by switching to using quotes we can avoid having this extra step. scripts/dtc/libfdt/libfdt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h index 73f4975..ea1ddcd 100644 --- a/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h @@ -51,8 +51,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include +#include "libfdt_env.h" +#include "fdt.h" #define FDT_FIRST_SUPPORTED_VERSION 0x10 #define FDT_LAST_SUPPORTED_VERSION 0x11