Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Kuba Piecuch and committed by
Tejun Heo
4615361f 3d3667f2

+1 -1
+1 -1
tools/sched_ext/include/scx/enums.h
··· 9 9 #ifndef __SCX_ENUMS_H 10 10 #define __SCX_ENUMS_H 11 11 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) 13 13 { 14 14 bool res; 15 15