diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-11-28 12:14:15 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-12-05 07:40:48 +0300 |
commit | f8eec91de8b9221bc2b29f3020ec67d9b46109c7 (patch) | |
tree | 3155f19feaa9790adecdaba655403d96cc93b49b | |
parent | fc82e84329760540ec62b257c700025ba37cb7ab (diff) | |
download | opensbi-f8eec91de8b9221bc2b29f3020ec67d9b46109c7.tar.xz |
lib: simplify fdt_parse_plmt_node()
We should not check !plmt_base || !plmt_size twice.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
-rw-r--r-- | lib/utils/fdt/fdt_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index 89b8bba..dbd7484 100644 --- a/lib/utils/fdt/fdt_helper.c +++ b/lib/utils/fdt/fdt_helper.c @@ -814,7 +814,7 @@ int fdt_parse_plmt_node(void *fdt, int nodeoffset, unsigned long *plmt_base, rc = fdt_get_node_addr_size(fdt, nodeoffset, 0, ®_addr, ®_size); - if (rc < 0 || !plmt_base || !plmt_size) + if (rc < 0) return SBI_ENODEV; *plmt_base = reg_addr; *plmt_size = reg_size; |