Skip to contentSkip to conversation

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

PATCH New Himanshu Chauhan 2 participants 3 messages Feb 20, 2025 – Mar 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: sbi: Return SBI_EALREADY error code if SSE event is present

Return SBI_EALREADY error code instead of SBI_INVAL, in case an event is already added to the supported list.

---
 lib/sbi/sbi_sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_sse.c +1 -1
index 9f22375..295d9bc 100644
@@ -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;
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 lib: sbi: Return SBI_EALREADY error code if SSE event is present

Quoted 5 lines · On Thu, Feb 20, 2025 at 2:48?PM Himanshu Chauhan <[email protected]>…

Return SBI_EALREADY error code instead of SBI_INVAL, in case an event is already added to the supported list.

LGTM.

Regards,
Anup

Quoted 25 lines
---
 lib/sbi/sbi_sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_sse.c +1 -2
index 9f22375..295d9bc 100644
@@ -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

Applied
#2 lore raw

PATCH 1/1 lib: sbi: Return SBI_EALREADY error code if SSE event is present

In reply to Himanshu Chauhan
Quoted 5 lines · On Thu, Feb 20, 2025 at 2:48?PM Himanshu Chauhan <[email protected]>…

Return SBI_EALREADY error code instead of SBI_INVAL, in case an event is already added to the supported list.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 25 lines
---
 lib/sbi/sbi_sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_sse.c +1 -2
index 9f22375..295d9bc 100644
@@ -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