devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Elwell <phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] dtc: Improve portability
Date: Tue, 21 Oct 2014 11:02:56 +0100	[thread overview]
Message-ID: <54462F50.4080706@raspberrypi.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

1) Remove the double parentheses around two comparisons in checks.c.
    The OSX LLVM-based C compiler warns about them.
2) Put an explicit "=" in the TN() macro, in accordance with c99.
---
  checks.c  | 4 ++--
  fdtdump.c | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/checks.c b/checks.c
index 47eda65..3bf0fa4 100644
--- a/checks.c
+++ b/checks.c
@@ -624,11 +624,11 @@ static void check_avoid_default_addr_size(struct 
check *c,
  struct node *dt,
         if (!reg && !ranges)
                 return;

-       if ((node->parent->addr_cells == -1))
+       if (node->parent->addr_cells == -1)
                 FAIL(c, "Relying on default #address-cells value for %s",
                      node->fullpath);

-       if ((node->parent->size_cells == -1))
+       if (node->parent->size_cells == -1)
                 FAIL(c, "Relying on default #size-cells value for %s",
                      node->fullpath);
  }
diff --git a/fdtdump.c b/fdtdump.c
index a29aa5e..95a6a20 100644
--- a/fdtdump.c
+++ b/fdtdump.c
@@ -22,7 +22,7 @@
  static const char *tagname(uint32_t tag)
  {
         static const char * const names[] = {
-#define TN(t) [t] #t
+#define TN(t) [t] = #t
                 TN(FDT_BEGIN_NODE),
                 TN(FDT_END_NODE),
                 TN(FDT_PROP),
--
1.9.1



[-- Attachment #2: 0001-Improve-portability.patch --]
[-- Type: text/plain, Size: 1366 bytes --]

From c80e173a0936091d6278cb6ced3710f485bc067a Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
Date: Fri, 17 Oct 2014 23:22:11 +0100
Subject: [PATCH] Improve portability

1) Remove the double parentheses around two comparisons in checks.c.
   The OSX LLVM-based C compiler warns about them.
2) Put an explicit "=" in the TN() macro, in accordance with c99.
---
 checks.c  | 4 ++--
 fdtdump.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/checks.c b/checks.c
index 47eda65..3bf0fa4 100644
--- a/checks.c
+++ b/checks.c
@@ -624,11 +624,11 @@ static void check_avoid_default_addr_size(struct check *c, struct node *dt,
 	if (!reg && !ranges)
 		return;
 
-	if ((node->parent->addr_cells == -1))
+	if (node->parent->addr_cells == -1)
 		FAIL(c, "Relying on default #address-cells value for %s",
 		     node->fullpath);
 
-	if ((node->parent->size_cells == -1))
+	if (node->parent->size_cells == -1)
 		FAIL(c, "Relying on default #size-cells value for %s",
 		     node->fullpath);
 }
diff --git a/fdtdump.c b/fdtdump.c
index a29aa5e..95a6a20 100644
--- a/fdtdump.c
+++ b/fdtdump.c
@@ -22,7 +22,7 @@
 static const char *tagname(uint32_t tag)
 {
 	static const char * const names[] = {
-#define TN(t) [t] #t
+#define TN(t) [t] = #t
 		TN(FDT_BEGIN_NODE),
 		TN(FDT_END_NODE),
 		TN(FDT_PROP),
-- 
1.9.1


             reply	other threads:[~2014-10-21 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 10:02 Phil Elwell [this message]
     [not found] ` <54462F50.4080706-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
2014-10-22 12:01   ` [PATCH] dtc: Improve portability David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2014-10-23 10:23 Phil Elwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54462F50.4080706@raspberrypi.org \
    --to=phil-fnsa7b+nu9xbibc87yurow@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).