aboutsummaryrefslogtreecommitdiff
path: root/dtc.c
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2023-08-31 13:39:18 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2023-09-04 15:27:55 +1000
commitad8bf9f9aa39625d732b7db16badecc0842750e2 (patch)
tree0c77b9276260f8815706d77dd4d25d8212722a27 /dtc.c
parent6c5e189fb9527c4f69f8bd80e34eb24878795c47 (diff)
downloaddtc-ad8bf9f9aa39625d732b7db16badecc0842750e2.zip
dtc-ad8bf9f9aa39625d732b7db16badecc0842750e2.tar.gz
dtc-ad8bf9f9aa39625d732b7db16badecc0842750e2.tar.bz2
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>
Diffstat (limited to 'dtc.c')
0 files changed, 0 insertions, 0 deletions