sched_ext: Make string params of __ENUM_set() const
PATCH 1/1 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 <[email protected]>
---
Not sure whether upstream cares about C++, but figured I'd send it in anyway. Also not sure if it merits CC'ing stable (probably not?) Would appreciate your input!
tools/sched_ext/include/scx/enums.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sched_ext/include/scx/enums.h +1 -1
@@ -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;
Signature · 1 line
2.53.0.1213.gd9a14994de-goog
Hello,
Quoted 1 line
Kuba Piecuch (1):
sched_ext: Make string params of__ENUM_set()const
Applied to sched_ext/for-7.1.
Thanks.
--
tejun