diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2018-03-16 18:27:03 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-06-07 11:48:20 +1000 |
commit | 6473a21d8bfe0eb923e4adfd2b536e79ca248081 (patch) | |
tree | 871dc02ffa021a469b8b8dc95fed5841926ac69b /util.h | |
parent | d5db5382c5e583d184e4484662eb87f1999d4a46 (diff) | |
download | dtc-6473a21d8bfe0eb923e4adfd2b536e79ca248081.zip dtc-6473a21d8bfe0eb923e4adfd2b536e79ca248081.tar.gz dtc-6473a21d8bfe0eb923e4adfd2b536e79ca248081.tar.bz2 |
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>
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -98,16 +98,10 @@ char get_escape_char(const char *s, int *i); * stderr. * * @param filename The filename to read, or - for stdin - * @return Pointer to allocated buffer containing fdt, or NULL on error - */ -char *utilfdt_read(const char *filename); - -/** - * Like utilfdt_read(), but also passes back the size of the file read. - * * @param len If non-NULL, the amount of data we managed to read + * @return Pointer to allocated buffer containing fdt, or NULL on error */ -char *utilfdt_read_len(const char *filename, off_t *len); +char *utilfdt_read(const char *filename, off_t *len); /** * Read a device tree file into a buffer. Does not report errors, but only @@ -116,16 +110,10 @@ char *utilfdt_read_len(const char *filename, off_t *len); * * @param filename The filename to read, or - for stdin * @param buffp Returns pointer to buffer containing fdt - * @return 0 if ok, else an errno value representing the error - */ -int utilfdt_read_err(const char *filename, char **buffp); - -/** - * Like utilfdt_read_err(), but also passes back the size of the file read. - * * @param len If non-NULL, the amount of data we managed to read + * @return 0 if ok, else an errno value representing the error */ -int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len); +int utilfdt_read_err(const char *filename, char **buffp, off_t *len); /** * Write a device tree buffer to a file. This will report any errors on |