All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dtc: Improve portability
@ 2014-10-23 10:23 Phil Elwell
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Elwell @ 2014-10-23 10:23 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

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.

Signed-off-by: Phil Elwell <phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
---
  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

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] dtc: Improve portability
       [not found] ` <54462F50.4080706-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
@ 2014-10-22 12:01   ` David Gibson
  0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2014-10-22 12:01 UTC (permalink / raw)
  To: Phil Elwell; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

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

On Tue, Oct 21, 2014 at 11:02:56AM +0100, Phil Elwell wrote:
> 1) Remove the double parentheses around two comparisons in checks.c.
>    The OSX LLVM-based C compiler warns about them.

That seems a weird thing to warn for, but the result is cleaner
anyway, so I'm happy to apply it.

> 2) Put an explicit "=" in the TN() macro, in accordance with c99.

I'm slightly astonished that ever worked.

I need a Signed-off-by line, then I can apply.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH] dtc: Improve portability
@ 2014-10-21 10:02 Phil Elwell
       [not found] ` <54462F50.4080706-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Elwell @ 2014-10-21 10:02 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- 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


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

end of thread, other threads:[~2014-10-23 10:23 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.