[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241022074035.139897-1-andrea.righi@linux.dev>
Date: Tue, 22 Oct 2024 09:40:35 +0200
From: Andrea Righi <andrea.righi@...ux.dev>
To: Tejun Heo <tj@...nel.org>,
David Vernet <void@...ifault.com>
Cc: Kumar Kartikeya Dwivedi <memxor@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH for-6.12-fixes] sched_ext: fix fmt__str variables in kfuncs
Commit 3e99aee7ce48 ("sched-ext: Use correct annotation for strings in
kfuncs") renamed some parameters without updating the body of the
functions, triggering build errors like this:
kernel/sched/ext.c:6881:45: error: ‘fmt’ undeclared (first use in this function)
6881 | if (bstr_format(&scx_exit_bstr_buf, fmt, data, data__sz) >= 0)
| ^~~
Fix by renaming also the varibles in the affected kfuncs.
Fixes: 3e99aee7ce48 ("sched-ext: Use correct annotation for strings in kfuncs")
Signed-off-by: Andrea Righi <andrea.righi@...ux.dev>
---
kernel/sched/ext.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index ff24d652c386..280beea63fa9 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -6738,7 +6738,7 @@ __bpf_kfunc void scx_bpf_exit_bstr(s64 exit_code, char *fmt__str,
unsigned long flags;
raw_spin_lock_irqsave(&scx_exit_bstr_buf_lock, flags);
- if (bstr_format(&scx_exit_bstr_buf, fmt, data, data__sz) >= 0)
+ if (bstr_format(&scx_exit_bstr_buf, fmt__str, data, data__sz) >= 0)
scx_ops_exit_kind(SCX_EXIT_UNREG_BPF, exit_code, "%s",
scx_exit_bstr_buf.line);
raw_spin_unlock_irqrestore(&scx_exit_bstr_buf_lock, flags);
@@ -6759,7 +6759,7 @@ __bpf_kfunc void scx_bpf_error_bstr(char *fmt__str, unsigned long long *data,
unsigned long flags;
raw_spin_lock_irqsave(&scx_exit_bstr_buf_lock, flags);
- if (bstr_format(&scx_exit_bstr_buf, fmt, data, data__sz) >= 0)
+ if (bstr_format(&scx_exit_bstr_buf, fmt__str, data, data__sz) >= 0)
scx_ops_exit_kind(SCX_EXIT_ERROR_BPF, 0, "%s",
scx_exit_bstr_buf.line);
raw_spin_unlock_irqrestore(&scx_exit_bstr_buf_lock, flags);
@@ -6791,10 +6791,10 @@ __bpf_kfunc void scx_bpf_dump_bstr(char *fmt__str, unsigned long long *data,
/* append the formatted string to the line buf */
ret = __bstr_format(buf->data, buf->line + dd->cursor,
- sizeof(buf->line) - dd->cursor, fmt, data, data__sz);
+ sizeof(buf->line) - dd->cursor, fmt__str, data, data__sz);
if (ret < 0) {
dump_line(dd->s, "%s[!] (\"%s\", %p, %u) failed to format (%d)",
- dd->prefix, fmt, data, data__sz, ret);
+ dd->prefix, fmt__str, data, data__sz, ret);
return;
}
--
2.47.0
Powered by blists - more mailing lists