提交 e130aa70 编写于 作者: M Mike Frysinger 提交者: Linus Torvalds

proc: constify status array

No need for this local array to be writable, so mark it const.
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0a8cb8e3
......@@ -131,7 +131,7 @@ static inline void task_name(struct seq_file *m, struct task_struct *p)
* you can test for combinations of others with
* simple bit tests.
*/
static const char *task_state_array[] = {
static const char * const task_state_array[] = {
"R (running)", /* 0 */
"S (sleeping)", /* 1 */
"D (disk sleep)", /* 2 */
......@@ -147,7 +147,7 @@ static const char *task_state_array[] = {
static inline const char *get_task_state(struct task_struct *tsk)
{
unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state;
const char **p = &task_state_array[0];
const char * const *p = &task_state_array[0];
BUILD_BUG_ON(1 + ilog2(TASK_STATE_MAX) != ARRAY_SIZE(task_state_array));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册