mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-14 00:37:41 -04:00
Replace FDT_VERSION() with stringify()
The FDT_VERSION() and _FDT_VERSION() macros don't really have anything specific to do with the fdt version. Rather, they're the common CPP "stringify" idiom. Move to util.h and rename to stringify() to reflect this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
2e6fe5a107
commit
2d45d1c5c6
2 changed files with 4 additions and 3 deletions
4
dtc.c
4
dtc.c
|
@ -59,8 +59,6 @@ static void fill_fullpaths(struct node *tree, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Usage related data. */
|
/* Usage related data. */
|
||||||
#define FDT_VERSION(version) _FDT_VERSION(version)
|
|
||||||
#define _FDT_VERSION(version) #version
|
|
||||||
static const char usage_synopsis[] = "dtc [options] <input file>";
|
static const char usage_synopsis[] = "dtc [options] <input file>";
|
||||||
static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@Ahv";
|
static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@Ahv";
|
||||||
static struct option const usage_long_opts[] = {
|
static struct option const usage_long_opts[] = {
|
||||||
|
@ -98,7 +96,7 @@ static const char * const usage_opts_help[] = {
|
||||||
"\t\tdts - device tree source text\n"
|
"\t\tdts - device tree source text\n"
|
||||||
"\t\tdtb - device tree blob\n"
|
"\t\tdtb - device tree blob\n"
|
||||||
"\t\tasm - assembler source",
|
"\t\tasm - assembler source",
|
||||||
"\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
|
"\n\tBlob version to produce, defaults to "stringify(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
|
||||||
"\n\tOutput dependency file",
|
"\n\tOutput dependency file",
|
||||||
"\n\tMake space for <number> reserve map entries (for dtb and asm output)",
|
"\n\tMake space for <number> reserve map entries (for dtb and asm output)",
|
||||||
"\n\tMake the blob at least <bytes> long (extra space)",
|
"\n\tMake the blob at least <bytes> long (extra space)",
|
||||||
|
|
3
util.h
3
util.h
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
|
||||||
|
#define stringify(s) stringify_(s)
|
||||||
|
#define stringify_(s) #s
|
||||||
|
|
||||||
static inline void NORETURN PRINTF(1, 2) die(const char *str, ...)
|
static inline void NORETURN PRINTF(1, 2) die(const char *str, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue