Consolidate utilfdt_read_len() variants

There are no less than _four_ variants on utilfdt_read() which is a bit
excessive.  The _len() variants are particularly pointless, since we can
achieve the same thing with very little extra verbosity by using the usual
convention of ignoring return parameters if they're NULL.  So, get rid of
them (we keep the shorter names without _len, but add now-optional len
parameters).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
David Gibson 2018-03-16 18:27:03 +11:00
parent d5db5382c5
commit 6473a21d8b
7 changed files with 15 additions and 38 deletions

View file

@ -204,7 +204,7 @@ int main(int argc, char *argv[])
usage("missing input filename");
file = argv[optind];
buf = utilfdt_read_len(file, &len);
buf = utilfdt_read(file, &len);
if (!buf)
die("could not read: %s\n", file);