diff mbox series

[2/5] spapr/ddw: Remove confuse return value in spapr_phb_get_free_liobn()

Message ID 20230216122524.67212-3-philmd@linaro.org
State New
Headers show
Series bulk: Have object_child_foreach() take Error* and return boolean | expand

Commit Message

Philippe Mathieu-Daudé Feb. 16, 2023, 12:25 p.m. UTC
The '1' returned value isn't used because
spapr_phb_get_free_liobn_cb() isn't called recursively
(it is only called once in spapr_phb_get_free_liobn()).

The next commit will convert object_child_foreach()
handlers to return a boolean indicating error.
Remove this value to avoid confusion.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/spapr_rtas_ddw.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Daniel Henrique Barboza Feb. 17, 2023, 10:31 a.m. UTC | #1
On 2/16/23 09:25, Philippe Mathieu-Daudé wrote:
> The '1' returned value isn't used because
> spapr_phb_get_free_liobn_cb() isn't called recursively
> (it is only called once in spapr_phb_get_free_liobn()).
> 
> The next commit will convert object_child_foreach()
> handlers to return a boolean indicating error.
> Remove this value to avoid confusion.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   hw/ppc/spapr_rtas_ddw.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr_rtas_ddw.c b/hw/ppc/spapr_rtas_ddw.c
> index 7ba11382bc..98f1310c6e 100644
> --- a/hw/ppc/spapr_rtas_ddw.c
> +++ b/hw/ppc/spapr_rtas_ddw.c
> @@ -51,7 +51,6 @@ static int spapr_phb_get_free_liobn_cb(Object *child, void *opaque)
>       tcet = (SpaprTceTable *) object_dynamic_cast(child, TYPE_SPAPR_TCE_TABLE);
>       if (tcet && !tcet->nb_table) {
>           *(uint32_t *)opaque = tcet->liobn;
> -        return 1;
>       }
>       return 0;
>   }
diff mbox series

Patch

diff --git a/hw/ppc/spapr_rtas_ddw.c b/hw/ppc/spapr_rtas_ddw.c
index 7ba11382bc..98f1310c6e 100644
--- a/hw/ppc/spapr_rtas_ddw.c
+++ b/hw/ppc/spapr_rtas_ddw.c
@@ -51,7 +51,6 @@  static int spapr_phb_get_free_liobn_cb(Object *child, void *opaque)
     tcet = (SpaprTceTable *) object_dynamic_cast(child, TYPE_SPAPR_TCE_TABLE);
     if (tcet && !tcet->nb_table) {
         *(uint32_t *)opaque = tcet->liobn;
-        return 1;
     }
     return 0;
 }