From bad5b28049e5e0562a8ad91797fb77953a53fa20 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 6 Mar 2017 12:08:53 +1100 Subject: 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 --- fdtget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fdtget.c') diff --git a/fdtget.c b/fdtget.c index fb9d0e1..8bd346b 100644 --- a/fdtget.c +++ b/fdtget.c @@ -105,7 +105,7 @@ static int show_data(struct display_info *disp, const char *data, int len) for (i = 0; i < len; i += size, p += size) { if (i) printf(" "); - value = size == 4 ? fdt32_to_cpu(*(const uint32_t *)p) : + value = size == 4 ? fdt32_to_cpu(*(const fdt32_t *)p) : size == 2 ? (*p << 8) | p[1] : *p; printf(fmt, value); } -- cgit v1.2.1