Subject: [PATCH] Define the default version

From: Jerry Van Baren <[email-masked]>
Date: Thu, 15 Mar 2007 19:46:52 -0400

Jon, David:

Thanks for updating dtc to v17.  This is a trivial patch to fix the 
usage (permanently) to show the correct version number in the usage help.

Thanks,
gvb
The default version is used in two places (someday maybe more).  Create
a #define to set the default version in one place.

Signed-off-by: [email-masked] <[email-masked]>
---
 dtc.c     |    4 ++--
 flat_dt.h |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dtc.c b/dtc.c
index f15d90f..61956f1 100644
--- a/dtc.c
+++ b/dtc.c
@@ -92,7 +92,7 @@ static void usage(void)
 	fprintf(stderr, "\t\t\tdtb - device tree blob\n");
 	fprintf(stderr, "\t\t\tasm - assembler source\n");
 	fprintf(stderr, "\t-V <output version>\n");
-	fprintf(stderr, "\t\tBlob version to produce, defaults to 16 (relevant for dtb\n\t\tand asm output only)\n");
+	fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", OF_DEFAULT_VERSION);
 	fprintf(stderr, "\t-R <number>\n");
 	fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
 	fprintf(stderr, "\t-b <number>\n");
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
 	int opt;
 	FILE *inf = NULL;
 	FILE *outf = NULL;
-	int outversion = 17;
+	int outversion = OF_DEFAULT_VERSION;
 	int reservenum = 1;
 	int boot_cpuid_phys = 0xfeedbeef;
 
diff --git a/flat_dt.h b/flat_dt.h
index d5abd80..a8482b4 100644
--- a/flat_dt.h
+++ b/flat_dt.h
@@ -2,6 +2,8 @@
 #define _FLAT_DT_H_

+#define OF_DEFAULT_VERSION	17
+
 #define OF_DT_HEADER            0xd00dfeed      /* 4: version, 4: total size */
 
 #define OF_DT_BEGIN_NODE	0x1             /* Start node: full name */
-- 
1.4.4.4