Skip to content

Commit 4615361

Browse files
Kuba Piecuchhtejun
authored andcommitted
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]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 3d3667f commit 4615361

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/sched_ext/include/scx/enums.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef __SCX_ENUMS_H
1010
#define __SCX_ENUMS_H
1111

12-
static inline void __ENUM_set(u64 *val, char *type, char *name)
12+
static inline void __ENUM_set(u64 *val, const char *type, const char *name)
1313
{
1414
bool res;
1515

0 commit comments

Comments
 (0)