Changeset 6505fe0e in rtems for cpukit

Timestamp:
03/26/19 15:33:00 (5 years ago)
Author:
Thierry Reding <treding@…>
Branches:
5, master
Children:
5a45775
Parents:
d5203fe
git-author:
Thierry Reding <treding@…> (03/26/19 15:33:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/02/20 06:52:19)
Message:

libfdt: Add new maximum phandle lookup function

The fdt_get_max_phandle() function has some shortcomings. On one hand
it returns just a uint32_t which means to check for the "negative"
error code a caller has to explicitly check against the error code
(uint32_t)-1. In addition, the -1 is the only error code that can be
returned, so a caller cannot tell the difference between the various
failures.

Fix this by adding a new fdt_find_max_phandle() function that returns an
error code on failure and 0 on success, just like other APIs, and stores
the maximum phandle value in an output argument on success.

This also refactors fdt_get_max_phandle() to use the new function. Add a
note pointing out that the new fdt_find_max_phandle() function should be
preferred over fdt_get_max_phandle().

Signed-off-by: Thierry Reding <treding@…>
Message-Id: <20190326153302.17109-1-thierry.reding@…>
[dwg: Reword for some inaccuracies in the commit message]
Signed-off-by: David Gibson <david@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.