[PATCH 2/2] lib: sbi: Simplify sbi_ipi_process remove goto

Anup Patel anup at brainfault.org
Thu May 11 00:26:21 PDT 2023


On Tue, Apr 25, 2023 at 2:26 PM Xiang W <wxjstz at 126.com> wrote:
>
> Signed-off-by: Xiang W <wxjstz at 126.com>

Please don't leave the commit description empty. Otherwise it looks good to me.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  lib/sbi/sbi_ipi.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c
> index ba83f24..ad09154 100644
> --- a/lib/sbi/sbi_ipi.c
> +++ b/lib/sbi/sbi_ipi.c
> @@ -223,14 +223,11 @@ void sbi_ipi_process(void)
>         ipi_type = atomic_raw_xchg_ulong(&ipi_data->ipi_type, 0);
>         ipi_event = 0;
>         while (ipi_type) {
> -               if (!(ipi_type & 1UL))
> -                       goto skip;
> -
> -               ipi_ops = ipi_ops_array[ipi_event];
> -               if (ipi_ops && ipi_ops->process)
> -                       ipi_ops->process(scratch);
> -
> -skip:
> +               if (ipi_type & 1UL) {
> +                       ipi_ops = ipi_ops_array[ipi_event];
> +                       if (ipi_ops && ipi_ops->process)
> +                               ipi_ops->process(scratch);
> +               }
>                 ipi_type = ipi_type >> 1;
>                 ipi_event++;
>         }
> --
> 2.39.2
>



More information about the opensbi mailing list