summaryrefslogtreecommitdiff
path: root/livetree.c
diff options
context:
space:
mode:
authorJerry Van Baren <gerald.vanbaren@comcast.net>2007-03-18 16:49:24 -0400
committerJon Loeliger <jdl@freescale.com>2007-03-19 08:54:40 -0500
commitcd1da8711641a4c7722742ce8b692b2b7cdadfc7 (patch)
treef133409389c8dfd23549a9de36b2946dee04a821 /livetree.c
parentb299ac76a7c2f58a0f44483b35b2d4d46bb6c0d9 (diff)
downloaddtc-cd1da8711641a4c7722742ce8b692b2b7cdadfc7.tar.gz
Improve options, #define default version.
Add -h option for help Add -q quiet option to reduce or suppress the whining Create #define for the default version value. Signed-off-by: vanbaren@cideas.com <vanbaren@cideas.com>
Diffstat (limited to 'livetree.c')
-rw-r--r--livetree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/livetree.c b/livetree.c
index 84f2f64..45642dc 100644
--- a/livetree.c
+++ b/livetree.c
@@ -252,8 +252,8 @@ static struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
* Tree checking functions
*/
-#define ERRMSG(...) fprintf(stderr, "ERROR: " __VA_ARGS__)
-#define WARNMSG(...) fprintf(stderr, "Warning: " __VA_ARGS__)
+#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
+#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
static int must_be_one_cell(struct property *prop, struct node *node)
{
@@ -512,13 +512,14 @@ static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys)
char *eptr;
unitnum = strtol(get_unitname(cpu), &eptr, 16);
- if (*eptr)
+ if (*eptr) {
WARNMSG("%s has bad format unit name %s (should be CPU number\n",
cpu->fullpath, get_unitname(cpu));
- else if (unitnum != propval_cell(prop))
+ } else if (unitnum != propval_cell(prop)) {
WARNMSG("%s unit name \"%s\" does not match \"reg\" property <%x>\n",
cpu->fullpath, get_unitname(cpu),
propval_cell(prop));
+ }
}
/* CHECK_HAVE_ONECELL(cpu, "d-cache-line-size"); */