powerpc: use is_init()
PATCH 1/1 powerpc: use is_init()
Use is_init() rather than hard coded pid comparison.
--- arch/powerpc/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/traps.c +1 -1
@@ -174,7 +174,7 @@ void _exception(int signr, struct pt_reg* generate the same exception over and over again and we get * nowhere. Better to kill it and let the kernel panic. */ -if (current->pid ==1 ) { +if (is_init (current)) {__sighandler_t handler;spin_lock_irq (¤t->sighand->siglock);
Quoted 1 line · Akinobu Mita
Use
is_init()rather than hard coded pid comparison.
What's the context of this patch? Why is this a good thing to do?
Doing a git grep -w is_init on Linus' current git tree reveals an is_init() in arch/parisc/kernel/module.c, which looks to be something different, but no generic definition of an is_init() function or macro.
Paul.
Quoted 6 lines · Paul Mackerras
Quoted 1 line · Akinobu Mita
Use
is_init()rather than hard coded pid comparison.What's the context of this patch? Why is this a good thing to do?
This is just minor cleanup patch.is_init() is available on 2.6.20-rc1 (include/linux/sched.h):
/**
* is_init - check if a task structure is init
* @tsk: Task structure to be checked.
*
* Check if a task structure is the first user space task the kernel created. */
static inline int is_init(struct task_struct *tsk)
{
return tsk->pid == 1;
}