[PATCH] lib: sbi: Return SBI_EALREADY error code if SSE event is present

Anup Patel anup at brainfault.org
Thu Feb 20 08:24:31 PST 2025


On Thu, Feb 20, 2025 at 2:48 PM Himanshu Chauhan
<hchauhan at ventanamicro.com> wrote:
>
> Return SBI_EALREADY error code instead of SBI_INVAL, in case an
> event is already added to the supported list.
>
> Signed-off-by: Himanshu Chauhan <hchauhan at ventanamicro.com>

LGTM.

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

Regards,
Anup

> ---
>  lib/sbi/sbi_sse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> index 9f22375..295d9bc 100644
> --- a/lib/sbi/sbi_sse.c
> +++ b/lib/sbi/sbi_sse.c
> @@ -926,7 +926,7 @@ int sbi_sse_add_event(uint32_t event_id, const struct sbi_sse_cb_ops *cb_ops)
>         /* Do not allow adding an event twice */
>         info = sse_event_info_get(event_id);
>         if (info)
> -               return SBI_EINVAL;
> +               return SBI_EALREADY;
>
>         if (cb_ops && cb_ops->set_hartid_cb && !EVENT_IS_GLOBAL(event_id))
>                 return SBI_EINVAL;
> --
> 2.43.0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list