Skip to content

Commit

Permalink
Change ifdef around dump_fdt() to shut up static analysis
Browse files Browse the repository at this point in the history
This is a dumb warning from a certain static analysis tool that a
function has no effect when the ifdef that would make it have an effect
isn't defined and we replace it with a no-op impl.

Putting the #ifdef around the call just so I don't have to discount this
damn static analysis false positive every time I go and look at the
results.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
stewartsmith committed Dec 11, 2018
1 parent 5ebb15d commit 88bf48a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ static void dump_fdt(void *fdt)
prlog(PR_INFO, "name: %s [%u]\n", name, off);
}
}
#else
static inline void dump_fdt(void *fdt __unused) { }
#endif

static void flatten_dt_properties(void *fdt, const struct dt_node *dn)
Expand Down Expand Up @@ -183,7 +181,9 @@ static int __create_dtb(void *fdt, size_t len,
return fdt_error;
}

#ifdef DEBUG_FDT
dump_fdt(fdt);
#endif
return 0;
}

Expand Down

0 comments on commit 88bf48a

Please sign in to comment.