Message ID | 20190815195114.31148-1-julien.grall@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xen/arm: domain_build: Remove redundant check in make_vpl011_uart_node() | expand |
Hi Julien, Julien Grall writes: > None of the code since the last check of res modify the value. So the > check can be removed. > > Coverity-ID: 1476824 > Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> > --- > xen/arch/arm/domain_build.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index cf9ffbc360..173544d8c5 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -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;
On Thu, 15 Aug 2019, Julien Grall wrote: > None of the code since the last check of res modify the value. So the > check can be removed. > > Coverity-ID: 1476824 > Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > --- > xen/arch/arm/domain_build.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index cf9ffbc360..173544d8c5 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -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; > -- > 2.11.0 >
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index cf9ffbc360..173544d8c5 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -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;
None of the code since the last check of res modify the value. So the check can be removed. Coverity-ID: 1476824 Signed-off-by: Julien Grall <julien.grall@arm.com> --- xen/arch/arm/domain_build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)