Re: [PATCH 2/5] Use macros instead of TASK_ flags

From: Ingo Molnar
Date: Wed Dec 05 2007 - 07:56:58 EST



* Matthew Wilcox <matthew@xxxxxx> wrote:

> +#define is_task_stopped(task) ((task->state & TASK_STOPPED) != 0)
> +#define is_task_stopped_or_traced(task) \
> + ((task->state & (TASK_STOPPED | TASK_TRACED)) != 0)
> +#define is_task_loadavg(task) ((task->state & TASK_UNINTERRUPTIBLE) != 0)

1) please change 'is' and 'task' around so that it reads nicer:

if (task_is_stopped(t))

instead of the tongue-twister:

if (is_task_stopped(t))

2) please change task_is_loadavg() to something more sensible - i didnt
know what it meant when i first saw it in -mm's sched.c.
task_is_uninterruptible() would be the logical choice ...

Ingo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/