diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-03-06 12:08:53 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-03-06 12:08:53 +1100 |
commit | bad5b28049e5e0562a8ad91797fb77953a53fa20 (patch) | |
tree | d58515b0213f4d1ce2d4012dd19070dc629f5c3d /util.c | |
parent | 672ac09ea04d998dfddfdef3070a8af8d480182b (diff) | |
download | dtc-bad5b28049e5e0562a8ad91797fb77953a53fa20.zip dtc-bad5b28049e5e0562a8ad91797fb77953a53fa20.tar.gz dtc-bad5b28049e5e0562a8ad91797fb77953a53fa20.tar.bz2 |
Fix assorted sparse warnings
This fixes a great many sparse warnings on the fdt and libfdt sources.
These are mostly due to incorrect mixing of endian annotated and native
integer types.
This includes fixing a couple of quasi-bugs where we had endian conversions
the wrong way around (this will have the right effect in practice, but is
certainly conceptually incorrect).
This doesn't make the whole tree sparse clean: there are many warnings in
bison and lex generated code, and there are a handful of other remaining
warnings that are (for now) more trouble than they're worth to fix (and
are not genuine bugs).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -396,7 +396,7 @@ void utilfdt_print_data(const char *data, int len) } while (s < data + len); } else if ((len % 4) == 0) { - const uint32_t *cell = (const uint32_t *)data; + const fdt32_t *cell = (const fdt32_t *)data; printf(" = <"); for (i = 0, len /= 4; i < len; i++) @@ -412,15 +412,16 @@ void utilfdt_print_data(const char *data, int len) } } -void util_version(void) +void NORETURN util_version(void) { printf("Version: %s\n", DTC_VERSION); exit(0); } -void util_usage(const char *errmsg, const char *synopsis, - const char *short_opts, struct option const long_opts[], - const char * const opts_help[]) +void NORETURN util_usage(const char *errmsg, const char *synopsis, + const char *short_opts, + struct option const long_opts[], + const char * const opts_help[]) { FILE *fp = errmsg ? stderr : stdout; const char a_arg[] = "<arg>"; |