Skip to contentSkip to conversation

dtc: Improve portability

PATCH New Phil Elwell 1 participant 1 message Oct 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dtc: 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(-)
checks.c +2 -2
index 47eda65..3bf0fa4 100644
@@ -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);
 }
fdtdump.c +1 -1
index a29aa5e..95a6a20 100644
@@ -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),
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html