lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5 03/15] sched.h: introduce TASK_COMM_LEN_16
Date
There're many hard-coded 16 used to store task comm in the kernel, that
makes it error prone if we want to change the value of TASK_COMM_LEN. A
new marco TASK_COMM_LEN_16 is introduced to replace these old ones, then
we can easily grep them.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Petr Mladek <pmladek@suse.com>
---
include/linux/sched.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index c1a927ddec64..62d5b30d310c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -274,6 +274,8 @@ struct task_group;

#define get_current_state() READ_ONCE(current->__state)

+/* To replace the old hard-coded 16 */
+#define TASK_COMM_LEN_16 16
/* Task command name length: */
#define TASK_COMM_LEN 16

--
2.17.1
\
 
 \ /
  Last update: 2021-10-21 05:45    [W:0.080 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site