public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: use is_init()
@ 2006-12-19  8:35 Akinobu Mita
  2006-12-20  4:06 ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Akinobu Mita @ 2006-12-19  8:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Mackerras, Anton Blanchard

Use is_init() rather than hard coded pid comparison.

Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 arch/powerpc/kernel/traps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6-mm/arch/powerpc/kernel/traps.c
===================================================================
--- 2.6-mm.orig/arch/powerpc/kernel/traps.c
+++ 2.6-mm/arch/powerpc/kernel/traps.c
@@ -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(&current->sighand->siglock);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: use is_init()
  2006-12-19  8:35 [PATCH] powerpc: use is_init() Akinobu Mita
@ 2006-12-20  4:06 ` Paul Mackerras
  2006-12-20  7:49   ` Akinobu Mita
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2006-12-20  4:06 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, Anton Blanchard

Akinobu Mita writes:

> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: use is_init()
  2006-12-20  4:06 ` Paul Mackerras
@ 2006-12-20  7:49   ` Akinobu Mita
  0 siblings, 0 replies; 3+ messages in thread
From: Akinobu Mita @ 2006-12-20  7:49 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linux-kernel, Anton Blanchard

On Wed, Dec 20, 2006 at 03:06:51PM +1100, Paul Mackerras wrote:
> Akinobu Mita writes:
> 
> > 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;
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-20  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19  8:35 [PATCH] powerpc: use is_init() Akinobu Mita
2006-12-20  4:06 ` Paul Mackerras
2006-12-20  7:49   ` Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox