Skip to contentSkip to conversation

sched/core: Add in additional const on preempt_modes array declaration

PATCH New Colin King 1 participant 1 message Apr 16, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 sched/core: Add in additional const on preempt_modes array declaration

From: Colin Ian King <[email protected]>

Checkpatch warnings that there is a missing const, fix this by adding it. Clean us up warning:

"WARNING: static const char * array should probably be static const char * const"

---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/core.c +1 -1
index 42c06fccade5..beaa6263f4c3 100644
@@ -5472,7 +5472,7 @@ static ssize_t sched_dynamic_write(struct file *filp, const char __user *ubuf,
 
 static int sched_dynamic_show(struct seq_file *m, void *v)
 {
-	static const char * preempt_modes[] = {
+	static const char * const preempt_modes[] = {
 		"none", "voluntary", "full"
 	};
 	int i;
Signature · 1 line
2.30.2