Skip to contentSkip to conversation

xen/arm: domain_build: Remove redundant check in make_vpl011_uart_node()

PATCH In review Julien Grall 3 participants 3 messages Aug 15, 2019 – Oct 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: domain_build: Remove redundant check in make_vpl011_uart_node()

None of the code since the last check of res modify the value. So the check can be removed.

Coverity-ID: 1476824

---
 xen/arch/arm/domain_build.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/arm/domain_build.c +1 -2
index cf9ffbc360..173544d8c5 100644
@@ -1629,8 +1629,7 @@ static int __init make_vpl011_uart_node(const struct domain *d, void *fdt)
     dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS,
                        GUEST_ROOT_SIZE_CELLS, GUEST_PL011_BASE,
                        GUEST_PL011_SIZE);
-    if ( res )
-        return res;
+
     res = fdt_property(fdt, "reg", reg, sizeof(reg));
     if ( res )
         return res;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi Julien,

Quoted 5 lines · Julien Grall

None of the code since the last check of res modify the value. So the check can be removed.

Coverity-ID: 1476824

Quoted 18 lines
---
 xen/arch/arm/domain_build.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/arm/domain_build.c +1 -2
index cf9ffbc360..173544d8c5 100644
@@ -1629,8 +1629,7 @@ static int __init make_vpl011_uart_node(const struct domain *d, void *fdt)
     dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS,
                        GUEST_ROOT_SIZE_CELLS, GUEST_PL011_BASE,
                        GUEST_PL011_SIZE);
-    if ( res )
-        return res;
+
     res = fdt_property(fdt, "reg", reg, sizeof(reg));
     if ( res )
         return res;
Signature · 5 lines
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Julien Grall
Quoted 5 lines · Julien Grall

None of the code since the last check of res modify the value. So the check can be removed.

Coverity-ID: 1476824

Quoted 21 lines
---
 xen/arch/arm/domain_build.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/arm/domain_build.c +1 -2
index cf9ffbc360..173544d8c5 100644
@@ -1629,8 +1629,7 @@ static int __init make_vpl011_uart_node(const struct domain *d, void *fdt)
     dt_child_set_range(&cells, GUEST_ROOT_ADDRESS_CELLS,
                        GUEST_ROOT_SIZE_CELLS, GUEST_PL011_BASE,
                        GUEST_PL011_SIZE);
-    if ( res )
-        return res;
+
     res = fdt_property(fdt, "reg", reg, sizeof(reg));
     if ( res )
         return res;
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel