Browse Source

libfdt: Make fdt_get_max_phandle() an inline

It's now a trivial wrapper around fdt_find_max_phandle() so we might as
well inline it.  We also remove it from the versioning linker script.
Theoretically, that's a breaking ABI change except that we haven't yet
released a version with it exposed in the shared object, so we can get
away with it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
David Gibson 6 years ago
parent
commit
cca6546244
  1. 12
      libfdt/fdt_ro.c
  2. 12
      libfdt/libfdt.h
  3. 1
      libfdt/version.lds

12
libfdt/fdt_ro.c

@ -172,18 +172,6 @@ int fdt_find_max_phandle(const void *fdt, uint32_t *phandle) @@ -172,18 +172,6 @@ int fdt_find_max_phandle(const void *fdt, uint32_t *phandle)
return 0;
}

uint32_t fdt_get_max_phandle(const void *fdt)
{
uint32_t phandle;
int err;

err = fdt_find_max_phandle(fdt, &phandle);
if (err < 0)
return (uint32_t)-1;

return phandle;
}

int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
{
uint32_t max;

12
libfdt/libfdt.h

@ -418,7 +418,17 @@ int fdt_find_max_phandle(const void *fdt, uint32_t *phandle); @@ -418,7 +418,17 @@ int fdt_find_max_phandle(const void *fdt, uint32_t *phandle);
* 0, if no phandle was found in the device tree
* -1, if an error occurred
*/
uint32_t fdt_get_max_phandle(const void *fdt);
static inline uint32_t fdt_get_max_phandle(const void *fdt)
{
uint32_t phandle;
int err;

err = fdt_find_max_phandle(fdt, &phandle);
if (err < 0)
return (uint32_t)-1;

return phandle;
}

/**
* fdt_generate_phandle - return a new, unused phandle for a device tree blob

1
libfdt/version.lds

@ -67,7 +67,6 @@ LIBFDT_1.2 { @@ -67,7 +67,6 @@ LIBFDT_1.2 {
fdt_overlay_apply;
fdt_get_string;
fdt_find_max_phandle;
fdt_get_max_phandle;
fdt_generate_phandle;
fdt_check_full;
fdt_setprop_placeholder;

Loading…
Cancel
Save