diff options
author | Rob Herring <robh@kernel.org> | 2018-11-21 15:53:57 -0600 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-11-22 17:14:19 +1100 |
commit | 86a288a7367086bb8dad60ea293811d62f59671b (patch) | |
tree | 310ad2360019b862c987ad2623589d0545d3b94e /checks.c | |
parent | 5667e7ef9a9a30c54a572ae976ed5b65ccf24d8b (diff) | |
download | device-tree-compiler-86a288a7367086bb8dad60ea293811d62f59671b.tar.gz |
checks: Restructure check_msg to decrease indentation
The entire check_msg function is under the if condition except for
va_start/va_end. Move these and invert the if condition saving a level
of indentation.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'checks.c')
-rw-r--r-- | checks.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -78,23 +78,23 @@ static inline void PRINTF(5, 6) check_msg(struct check *c, struct dt_info *dti, const char *fmt, ...) { va_list ap; - va_start(ap, fmt); - if ((c->warn && (quiet < 1)) - || (c->error && (quiet < 2))) { - fprintf(stderr, "%s: %s (%s): ", - strcmp(dti->outname, "-") ? dti->outname : "<stdout>", - (c->error) ? "ERROR" : "Warning", c->name); - if (node) { - fprintf(stderr, "%s", node->fullpath); - if (prop) - fprintf(stderr, ":%s", prop->name); - fputs(": ", stderr); - } - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + if (!(c->warn && (quiet < 1)) && !(c->error && (quiet < 2))) + return; + + fprintf(stderr, "%s: %s (%s): ", + strcmp(dti->outname, "-") ? dti->outname : "<stdout>", + (c->error) ? "ERROR" : "Warning", c->name); + if (node) { + fprintf(stderr, "%s", node->fullpath); + if (prop) + fprintf(stderr, ":%s", prop->name); + fputs(": ", stderr); } + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); va_end(ap); + fprintf(stderr, "\n"); } #define FAIL(c, dti, node, ...) \ |