diff options
| author | Kuba Piecuch <jpiecuch@google.com> | 2026-04-13 15:49:02 +0300 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-04-13 19:14:05 +0300 |
| commit | 4615361f0b148c172852590e6245a953cc075b73 (patch) | |
| tree | e67f4b918938c0e9f32e81fdf524f1473184c71e /tools | |
| parent | 3d3667f265148d856bc6eb54d1bd780a94e38da7 (diff) | |
| download | linux-4615361f0b148c172852590e6245a953cc075b73.tar.xz | |
sched_ext: Make string params of __ENUM_set() const
A small change to improve type safety/const correctness.
__COMPAT_read_enum() already has const string parameters.
It fixes a warning when using the header in C++ code:
error: ISO C++11 does not allow conversion from string literal
to 'char *' [-Werror,-Wwritable-strings]
That's because string literals have type char[N] in C and
const char[N] in C++.
Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/sched_ext/include/scx/enums.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/sched_ext/include/scx/enums.h b/tools/sched_ext/include/scx/enums.h index 8e7c91575f0b..c3b09acce824 100644 --- a/tools/sched_ext/include/scx/enums.h +++ b/tools/sched_ext/include/scx/enums.h @@ -9,7 +9,7 @@ #ifndef __SCX_ENUMS_H #define __SCX_ENUMS_H -static inline void __ENUM_set(u64 *val, char *type, char *name) +static inline void __ENUM_set(u64 *val, const char *type, const char *name) { bool res; |
