From patchwork Fri Jan 18 11:59:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Van Baren X-Patchwork-Id: 213603 X-Patchwork-Delegate: vanbaren@cideas.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A9BED2C0079 for ; Fri, 18 Jan 2013 23:19:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2D1A04A10A; Fri, 18 Jan 2013 13:19:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0PFjG3+pvvds; Fri, 18 Jan 2013 13:19:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B85C94A10F; Fri, 18 Jan 2013 13:19:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A78E84A10A for ; Fri, 18 Jan 2013 13:08:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F0l8XjcX-1RK for ; Fri, 18 Jan 2013 13:08:09 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com [209.85.223.176]) by theia.denx.de (Postfix) with ESMTPS id 2FA0A4A0F9 for ; Fri, 18 Jan 2013 13:08:07 +0100 (CET) Received: by mail-ie0-f176.google.com with SMTP id 13so6156107iea.21 for ; Fri, 18 Jan 2013 04:08:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=oeVbh+ZzvjuNtlDkXqlgg9df6gf+qaw8pqfTJI20ckc=; b=KYPN45eag2oBegWpkOX+M68XlVX4Yzwk4qyc3bLbdyXuuW1b26TnOvWOeW4arFsNgP fVfiQllCtL5gx8QrLp3CaCVToh5PDo5hvBEyC4oWlMOY+0PV4rtJlgPgqkgyJKW/T3hT N/icJ64sbaYsALzXq4Lois+JbV7MXiDFmZx4RFmLsOGpe0TpWpOBqO+2dzwOoebOR8lL v9wFAPuB+LoX7NH1+MIX5FoifBwKm/TZmbC7vw0itwp/YY0o6ykhjb7c38RGsTsdeCUG UEAZxgC+vvNSrf9MO+ITa9sW5TqY221E1AVuDPPHjWqYvqQf04WFbxuU8Yk8Ug0nj4kV R8/A== X-Received: by 10.50.153.169 with SMTP id vh9mr1753493igb.68.1358510388658; Fri, 18 Jan 2013 03:59:48 -0800 (PST) Received: from [192.168.47.216] (c-107-5-177-244.hsd1.mi.comcast.net. [107.5.177.244]) by mx.google.com with ESMTPS id nj1sm1799926igc.3.2013.01.18.03.59.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jan 2013 03:59:47 -0800 (PST) Message-ID: <50F93932.60700@cideas.com> Date: Fri, 18 Jan 2013 06:59:46 -0500 From: Gerald Van Baren User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: David Gibson References: <20130116175904.47ee25bd2596f28796698759@freescale.com> <1358382963.18317.17@snotra> <20130117115456.71a38e3275230cdbb175bfe4@freescale.com> <50F843CD.1030309@cideas.com> <20130117235048.GF26321@truffula.fritz.box> In-Reply-To: <20130117235048.GF26321@truffula.fritz.box> X-Enigmail-Version: 1.4.6 X-Gm-Message-State: ALoCoQkp60SZfRJn2zfVU+sEvjzhO2QlUtVpLX69Q4Mb/Dkm0JdNs0bZ8/YEbv0CCd2p8RzaCwKc X-Mailman-Approved-At: Fri, 18 Jan 2013 13:19:30 +0100 Cc: Scott Wood , u-boot@lists.denx.de, devicetree-discuss@lists.ozlabs.org, Kim Phillips Subject: Re: [U-Boot] [PATCH 1/5] treewide: include libfdt_env.h before fdt.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On 01/17/2013 06:50 PM, David Gibson wrote: > On Thu, Jan 17, 2013 at 01:32:45PM -0500, Jerry Van Baren wrote: >> Hi Scott, Kim, David, [snip] >> libfdt_env.h is where Kim typedef'ed fdt16_t, fdt32_t, fdt64_t >> >> I suspect the original intent was to have be the file >> that people #included. For whatever reason, most includes are >> (picking on fdt_ro.c arbitrarily): 51 #include "libfdt_env.h" 53 >> #include 54 #include Since libfdt.h #includes >> fdt.h and libfdt_env.h, lines 51 and 53 (above) are redundant. >> It sorts out OK in dtc because libfdt_env.h includes stdint.h and >> defines fdt*_t, but it messes me up in u-boot where (currently) >> libfdt_env.h does *not* include stdint.h... > > Ok, so, the uboot libfdt_env.h should be fixed to define uintXX_t > and fdtXX_t (either by including stdint or my other means). The > purpose of libfdt_env.h is to define the things that libfdt > requires, and those types are (now) such a requirement. I like the move, but have not done it (yet). I made a trial patch (see below) that uses libfdt.h as the interface and cleans out the (now redundant) other *fdt*.h includes. If this is in the right direction, I'll move the fdtXX_t typedefs and formally submit it. The test suite has one failure, but it fails with or without my changes. $ make check | grep FAIL fdtget-runtest.sh 77 121 66 111 97 114 100 78 97 109 101 0 77 121 66 111 97 114 100 70 97 109 105 108 121 78 97 109 101 0 label01.dts.fdtget.test.dtb / compatible: FAIL Results differ from expected * FAIL: 1 ********** TEST SUMMARY * Total testcases: 1443 * PASS: 1442 * FAIL: 1 * Bad configuration: 0 * Strange test result: 0 ********** gvb From 1fb0193670e012072d4a9e5ac480e3201aaf30fd Mon Sep 17 00:00:00 2001 From: Gerald Van Baren Date: Thu, 17 Jan 2013 21:14:01 -0500 Subject: [PATCH] Use the libfdt.h include as the interface definition libfdt.h is the libfdt interface definition. It includes fdt.h and libfdt_env.h, so there is no reason to include those in the general code. Signed-off-by: Gerald Van Baren --- dtc.h | 3 +-- fdtdump.c | 3 +-- libfdt/fdt.c | 3 --- libfdt/fdt_empty_tree.c | 3 --- libfdt/fdt_ro.c | 3 --- libfdt/fdt_rw.c | 3 --- libfdt/fdt_strerror.c | 3 --- libfdt/fdt_sw.c | 3 --- libfdt/fdt_wip.c | 3 --- libfdt/libfdt_internal.h | 1 - 10 files changed, 2 insertions(+), 26 deletions(-) diff --git a/dtc.h b/dtc.h index 3e42a07..a032645 100644 --- a/dtc.h +++ b/dtc.h @@ -32,8 +32,7 @@ #include #include -#include -#include +#include #include "util.h" diff --git a/fdtdump.c b/fdtdump.c index b2c5b37..3919490 100644 --- a/fdtdump.c +++ b/fdtdump.c @@ -8,8 +8,7 @@ #include #include -#include -#include +#include #include "util.h" diff --git a/libfdt/fdt.c b/libfdt/fdt.c index 57faba3..19b9043 100644 --- a/libfdt/fdt.c +++ b/libfdt/fdt.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" int fdt_check_header(const void *fdt) diff --git a/libfdt/fdt_empty_tree.c b/libfdt/fdt_empty_tree.c index f72d13b..30c5525 100644 --- a/libfdt/fdt_empty_tree.c +++ b/libfdt/fdt_empty_tree.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" int fdt_create_empty_tree(void *buf, int bufsize) diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index 42da2bd..53c61ed 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" static int _fdt_nodename_eq(const void *fdt, int offset, diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c index fdba618..b6a8815 100644 --- a/libfdt/fdt_rw.c +++ b/libfdt/fdt_rw.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" static int _fdt_blocks_misordered(const void *fdt, diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c index e6c3cee..c55793c 100644 --- a/libfdt/fdt_strerror.c +++ b/libfdt/fdt_strerror.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" struct fdt_errtabent { diff --git a/libfdt/fdt_sw.c b/libfdt/fdt_sw.c index f422754..85aaedf 100644 --- a/libfdt/fdt_sw.c +++ b/libfdt/fdt_sw.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" static int _fdt_sw_check_header(void *fdt) diff --git a/libfdt/fdt_wip.c b/libfdt/fdt_wip.c index c5bbb68..67fa7ca 100644 --- a/libfdt/fdt_wip.c +++ b/libfdt/fdt_wip.c @@ -48,11 +48,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "libfdt_env.h" -#include #include - #include "libfdt_internal.h" int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h index 381133b..a8b36f4 100644 --- a/libfdt/libfdt_internal.h +++ b/libfdt/libfdt_internal.h @@ -50,7 +50,6 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))