mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-07 13:45:07 -05:00
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>
This commit is contained in:
parent
5667e7ef9a
commit
86a288a736
1 changed files with 14 additions and 14 deletions
28
checks.c
28
checks.c
|
|
@ -78,23 +78,23 @@ static inline void PRINTF(5, 6) check_msg(struct check *c, struct dt_info *dti,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
|
||||||
|
|
||||||
if ((c->warn && (quiet < 1))
|
if (!(c->warn && (quiet < 1)) && !(c->error && (quiet < 2)))
|
||||||
|| (c->error && (quiet < 2))) {
|
return;
|
||||||
fprintf(stderr, "%s: %s (%s): ",
|
|
||||||
strcmp(dti->outname, "-") ? dti->outname : "<stdout>",
|
fprintf(stderr, "%s: %s (%s): ",
|
||||||
(c->error) ? "ERROR" : "Warning", c->name);
|
strcmp(dti->outname, "-") ? dti->outname : "<stdout>",
|
||||||
if (node) {
|
(c->error) ? "ERROR" : "Warning", c->name);
|
||||||
fprintf(stderr, "%s", node->fullpath);
|
if (node) {
|
||||||
if (prop)
|
fprintf(stderr, "%s", node->fullpath);
|
||||||
fprintf(stderr, ":%s", prop->name);
|
if (prop)
|
||||||
fputs(": ", stderr);
|
fprintf(stderr, ":%s", prop->name);
|
||||||
}
|
fputs(": ", stderr);
|
||||||
vfprintf(stderr, fmt, ap);
|
|
||||||
fprintf(stderr, "\n");
|
|
||||||
}
|
}
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FAIL(c, dti, node, ...) \
|
#define FAIL(c, dti, node, ...) \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue