Thread (13 messages) 13 messages, 3 authors, 2025-05-23

Re: [PATCH v4 3/4] drivers: firmware: add riscv SSE support

From: Qingfang Deng <dqfext@gmail.com>
Date: 2025-05-21 07:46:37
Also in: linux-riscv, lkml

Hi Clément,

On Fri, 16 May 2025 17:23:41 +0200, Clément Léger wrote:
+static struct sse_event *sse_event_get(u32 evt)
+{
+	struct sse_event *event = NULL, *tmp;
+
+	scoped_guard(spinlock, &events_list_lock) {
+		list_for_each_entry(tmp, &events, list) {
+			if (tmp->evt_id == evt)
+				return event;
`event` is not being updated by the loop and therefore is always NULL.
Did you mean to return `tmp`?
+		}
+	}
+
+	return NULL;
+}
<snip>
+static int __init sse_init(void)
+{
+	int cpu, ret;
+
+	if (sbi_probe_extension(SBI_EXT_SSE) <= 0) {
+		pr_err("Missing SBI SSE extension\n");
+		return -EOPNOTSUPP;
+	}
+	pr_info("SBI SSE extension detected\n");
+
+	for_each_possible_cpu(cpu)
+		INIT_LIST_HEAD(&events);
`events` is already initialized.

Qingfang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help