dtc/libfdt
Pierre-Clément Tosi ad8bf9f9aa libfdt: Fix fdt_appendprop_addrrange documentation
According to the documentation, the function should default to the very
common property name <reg> when none is "specified". However, neither
passing NULL (ends up calling strlen(NULL) and segfaults) nor ""
(appends a property with an empty name) implements this behavior.

Furthermore, the test case supposed to cover this default value actually
passes the value to the function, somewhat defeating its own purpose:

    /* 2. default property name */

    // ...

    err = fdt_appendprop_addrrange(fdt, 0, offset, "reg", addr, size);
    if (err)
            FAIL("Failed to set \"reg\": %s", fdt_strerror(err));
    check_getprop_addrrange(fdt, 0, offset, "reg", 1);

Finally, nothing in the implementation of the function seems to attempt
to cover that use-case.

As the feature can't ever have been used by clients and as the resulting
reduced readability of the caller seems (IMO) to outweigh any potential
benefit this API would bring, remove the erroneous documentation instead
of trying to fix the function.

Reported-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Message-ID: <20230831123918.rf54emwkzgtcb7aw@google.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-09-04 15:27:55 +10:00
..
.gitignore
Makefile.libfdt libfdt: rename libfdt-X.Y.Z.so to libfdt.so.X.Y.Z 2023-08-06 14:53:29 +10:00
TODO
fdt.c libfdt: prevent integer overflow in fdt_next_tag 2022-10-12 10:49:36 +11:00
fdt.h libfdt: Replace deprecated 0-length arrays with proper flexible arrays 2023-01-29 14:42:57 +11:00
fdt_addresses.c libfdt: fix an incorrect integer promotion 2021-11-17 12:22:53 +11:00
fdt_check.c libfdt: Don't mask fdt_get_name() returned error 2022-07-30 13:52:33 +10:00
fdt_empty_tree.c
fdt_overlay.c libfdt: overlay: make overlay_get_target() public 2021-11-18 16:25:10 +11:00
fdt_ro.c add fdt_get_symbol() and fdt_get_symbol_namelen() functions 2023-05-03 23:51:08 +10:00
fdt_rw.c Fix CID 1461557 2021-06-08 16:32:59 +10:00
fdt_strerror.c libfdt: Add ALIGNMENT error string 2021-08-02 12:21:53 +10:00
fdt_sw.c Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into 2021-01-04 12:26:37 +11:00
fdt_wip.c libfdt: libfdt_wip: Fix comparison warning 2020-10-02 10:30:07 +10:00
libfdt.h libfdt: Fix fdt_appendprop_addrrange documentation 2023-09-04 15:27:55 +10:00
libfdt_env.h
libfdt_internal.h libfdt: Tweak description of assume-aligned load helpers 2020-12-16 16:52:17 +11:00
meson.build libfdt: fix library version to match project version 2023-08-01 13:09:19 +10:00
version.lds libfdt: add missing version symbols 2023-08-04 18:02:33 +10:00