From d6fc90ced42e9fb77185cedfe45d0a2c7ac78508 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Sat, 23 Sep 2017 17:30:53 -0400 Subject: scripts/dtc: Update to upstream version v1.4.4 This adds the following commits from upstream: 558cd81bdd43 dtc: Bump version to v1.4.4 c17a811c62eb fdtput: Remove star from value_len documentation 194d5caaefcb fdtget: Use @return to document the return value d922ecdd017b tests: Make realloc_fdt() really allocate *fdt 921cc17fec29 libfdt: overlay: Check the value of the right variable 9ffdf60bf463 dtc: Simplify asm_emit_string() implementation 881012e44386 libfdt: Change names of sparse helper macros bad5b28049e5 Fix assorted sparse warnings 672ac09ea04d Clean up gcc attributes 49300f2ade6a dtc: Don't abuse struct fdt_reserve_entry Signed-off-by: Tom Rini --- scripts/dtc/util.h | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'scripts/dtc/util.h') diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h index bc3d223fa6..ad5f41199e 100644 --- a/scripts/dtc/util.h +++ b/scripts/dtc/util.h @@ -25,15 +25,17 @@ * USA */ -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - #ifdef __GNUC__ -static inline void -__attribute__((noreturn)) __attribute__((format (printf, 1, 2))) -die(const char *str, ...) +#define PRINTF(i, j) __attribute__((format (printf, i, j))) +#define NORETURN __attribute__((noreturn)) #else -static inline void die(const char *str, ...) +#define PRINTF(i, j) +#define NORETURN #endif + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static inline void NORETURN PRINTF(1, 2) die(const char *str, ...) { va_list ap; @@ -66,12 +68,7 @@ static inline void *xrealloc(void *p, size_t len) extern char *xstrdup(const char *s); -#ifdef __GNUC__ -extern int __attribute__((format (printf, 2, 3))) -xasprintf(char **strp, const char *fmt, ...); -#else -extern int xasprintf(char **strp, const char *fmt, ...); -#endif +extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); extern char *join_path(const char *path, const char *name); /** @@ -200,7 +197,7 @@ void utilfdt_print_data(const char *data, int len); /** * Show source version and exit */ -void util_version(void) __attribute__((noreturn)); +void NORETURN util_version(void); /** * Show usage and exit @@ -214,9 +211,10 @@ void util_version(void) __attribute__((noreturn)); * @param long_opts The structure of long options * @param opts_help An array of help strings (should align with long_opts) */ -void util_usage(const char *errmsg, const char *synopsis, - const char *short_opts, struct option const long_opts[], - const char * const opts_help[]) __attribute__((noreturn)); +void NORETURN util_usage(const char *errmsg, const char *synopsis, + const char *short_opts, + struct option const long_opts[], + const char * const opts_help[]); /** * Show usage and exit -- cgit v1.2.3