aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 96361e8fa3a..f560325c444 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -134,14 +134,14 @@ static inline void task_name(struct seq_file *m, struct task_struct *p)
134 * simple bit tests. 134 * simple bit tests.
135 */ 135 */
136static const char *task_state_array[] = { 136static const char *task_state_array[] = {
137 "R (running)", /* 0 */ 137 "R (running)", /* 0 */
138 "S (sleeping)", /* 1 */ 138 "S (sleeping)", /* 1 */
139 "D (disk sleep)", /* 2 */ 139 "D (disk sleep)", /* 2 */
140 "T (stopped)", /* 4 */ 140 "T (stopped)", /* 4 */
141 "t (tracing stop)", /* 8 */ 141 "t (tracing stop)", /* 8 */
142 "Z (zombie)", /* 16 */ 142 "Z (zombie)", /* 16 */
143 "X (dead)", /* 32 */ 143 "X (dead)", /* 32 */
144 "x (dead)", /* 64 */ 144 "x (dead)", /* 64 */
145 "K (wakekill)", /* 128 */ 145 "K (wakekill)", /* 128 */
146 "W (waking)", /* 256 */ 146 "W (waking)", /* 256 */
147}; 147};
@@ -151,6 +151,8 @@ static inline const char *get_task_state(struct task_struct *tsk)
151 unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state; 151 unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state;
152 const char **p = &task_state_array[0]; 152 const char **p = &task_state_array[0];
153 153
154 BUILD_BUG_ON(1 + ilog2(TASK_STATE_MAX) != ARRAY_SIZE(task_state_array));
155
154 while (state) { 156 while (state) {
155 p++; 157 p++;
156 state >>= 1; 158 state >>= 1;