LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fork.c: cleanup for copy_sighand()
@ 2008-10-31  8:51 Zhaolei
  2008-11-04 23:54 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Zhaolei @ 2008-10-31  8:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

Check CLONE_SIGHAND only is enough, because combination of CLONE_THREAD and
CLONE_SIGHAND is already done in copy_process().

Impact: cleanup, no functionality changed

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 kernel/fork.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index f608356..36a0dac 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -741,7 +741,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
 {
 	struct sighand_struct *sig;
 
-	if (clone_flags & (CLONE_SIGHAND | CLONE_THREAD)) {
+	if (clone_flags & CLONE_SIGHAND) {
 		atomic_inc(&current->sighand->count);
 		return 0;
 	}
-- 
1.5.5.3



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

* Re: [PATCH] fork.c: cleanup for copy_sighand()
  2008-10-31  8:51 [PATCH] fork.c: cleanup for copy_sighand() Zhaolei
@ 2008-11-04 23:54 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-11-04 23:54 UTC (permalink / raw)
  To: Zhaolei; +Cc: linux-kernel, Roland McGrath, Oleg Nesterov

On Fri, 31 Oct 2008 16:51:19 +0800
Zhaolei <zhaolei@cn.fujitsu.com> wrote:

> Check CLONE_SIGHAND only is enough, because combination of CLONE_THREAD and
> CLONE_SIGHAND is already done in copy_process().
> 
> Impact: cleanup, no functionality changed
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> ---
>  kernel/fork.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/fork.c b/kernel/fork.c
> index f608356..36a0dac 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -741,7 +741,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
>  {
>  	struct sighand_struct *sig;
>  
> -	if (clone_flags & (CLONE_SIGHAND | CLONE_THREAD)) {
> +	if (clone_flags & CLONE_SIGHAND) {
>  		atomic_inc(&current->sighand->count);
>  		return 0;
>  	}

OK, it appears to be correct and might yield a tiny speedup on some
architectures.

But whether this change is desirable from a clarity and maintainability
point of view is unclear to me.  Let's add the cc's..


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

end of thread, other threads:[~2008-11-04 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-31  8:51 [PATCH] fork.c: cleanup for copy_sighand() Zhaolei
2008-11-04 23:54 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).