public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-7.1] sched_ext: Make string params of __ENUM_set() const
@ 2026-04-13 12:49 Kuba Piecuch
  2026-04-13 16:21 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Kuba Piecuch @ 2026-04-13 12:49 UTC (permalink / raw)
  To: Tejun Heo, Andrea Righi, Changwoo Min, David Vernet
  Cc: linux-kernel, sched-ext, Kuba Piecuch

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>
---

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(-)

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;
 
-- 
2.53.0.1213.gd9a14994de-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH sched_ext/for-7.1] sched_ext: Make string params of __ENUM_set() const
  2026-04-13 12:49 [PATCH sched_ext/for-7.1] sched_ext: Make string params of __ENUM_set() const Kuba Piecuch
@ 2026-04-13 16:21 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-04-13 16:21 UTC (permalink / raw)
  To: Kuba Piecuch, Andrea Righi, Changwoo Min, David Vernet
  Cc: linux-kernel, sched-ext

Hello,

> Kuba Piecuch (1): sched_ext: Make string params of __ENUM_set() const

Applied to sched_ext/for-7.1.

Thanks.
--
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-13 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 12:49 [PATCH sched_ext/for-7.1] sched_ext: Make string params of __ENUM_set() const Kuba Piecuch
2026-04-13 16:21 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox