From: Kuba Piecuch Date: Mon, 13 Apr 2026 12:49:02 +0000 (+0000) Subject: sched_ext: Make string params of __ENUM_set() const X-Git-Tag: v7.1-rc1~162^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4615361f0b148c172852590e6245a953cc075b73;p=thirdparty%2Flinux.git 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 Signed-off-by: Tejun Heo --- diff --git a/tools/sched_ext/include/scx/enums.h b/tools/sched_ext/include/scx/enums.h index 8e7c91575f0b3..c3b09acce824a 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;