linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] kernel/nsproxy.c: Improving a snippet of code.
@ 2013-02-27 18:32 Raphael S.Carvalho
  2013-02-27 20:09 ` Serge Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael S.Carvalho @ 2013-02-27 18:32 UTC (permalink / raw)
  To: Eric W. Biederman, Serge Hallyn, David S. Miller, Serge E. Hallyn
  Cc: linux-kernel, Raphael S.Carvalho

It seems GCC generates a better code in that way, so I changed that statement.
Btw, they have the same semantic, so I'm sending this patch due to performance issues.

Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
---
 kernel/nsproxy.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 78e2ecb..21da3d1 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -148,7 +148,8 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk)
 	 * means share undolist with parent, so we must forbid using
 	 * it along with CLONE_NEWIPC.
 	 */
-	if ((flags & CLONE_NEWIPC) && (flags & CLONE_SYSVSEM)) {
+	if ((flags & (CLONE_NEWIPC | CLONE_SYSVSEM)) ==
+		(CLONE_NEWIPC | CLONE_SYSVSEM)) {
 		err = -EINVAL;
 		goto out;
 	}
-- 
1.7.2.5


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

* Re: [PATCH 1/1] kernel/nsproxy.c: Improving a snippet of code.
  2013-02-27 18:32 [PATCH 1/1] kernel/nsproxy.c: Improving a snippet of code Raphael S.Carvalho
@ 2013-02-27 20:09 ` Serge Hallyn
  2013-02-27 23:14   ` Eric W. Biederman
  0 siblings, 1 reply; 3+ messages in thread
From: Serge Hallyn @ 2013-02-27 20:09 UTC (permalink / raw)
  To: Raphael S.Carvalho
  Cc: Eric W. Biederman, Serge Hallyn, David S. Miller,
	Serge E. Hallyn, linux-kernel

Quoting Raphael S.Carvalho (raphael.scarv@gmail.com):
> It seems GCC generates a better code in that way, so I changed that statement.
> Btw, they have the same semantic, so I'm sending this patch due to performance issues.
> 
> Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>

Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

> ---
>  kernel/nsproxy.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
> index 78e2ecb..21da3d1 100644
> --- a/kernel/nsproxy.c
> +++ b/kernel/nsproxy.c
> @@ -148,7 +148,8 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk)
>  	 * means share undolist with parent, so we must forbid using
>  	 * it along with CLONE_NEWIPC.
>  	 */
> -	if ((flags & CLONE_NEWIPC) && (flags & CLONE_SYSVSEM)) {
> +	if ((flags & (CLONE_NEWIPC | CLONE_SYSVSEM)) ==
> +		(CLONE_NEWIPC | CLONE_SYSVSEM)) {
>  		err = -EINVAL;
>  		goto out;
>  	}
> -- 
> 1.7.2.5
> 

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

* Re: [PATCH 1/1] kernel/nsproxy.c: Improving a snippet of code.
  2013-02-27 20:09 ` Serge Hallyn
@ 2013-02-27 23:14   ` Eric W. Biederman
  0 siblings, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2013-02-27 23:14 UTC (permalink / raw)
  To: Serge Hallyn
  Cc: Raphael S.Carvalho, Serge Hallyn, David S. Miller,
	Serge E. Hallyn, linux-kernel

Serge Hallyn <serge.hallyn@ubuntu.com> writes:

> Quoting Raphael S.Carvalho (raphael.scarv@gmail.com):
>> It seems GCC generates a better code in that way, so I changed that statement.
>> Btw, they have the same semantic, so I'm sending this patch due to performance issues.
>> 
>> Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
>
> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

Thanks all.  Added to my development tree. I will push it out in my
for-next branch after 3.9-rc1 is released.

Eric

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

end of thread, other threads:[~2013-02-27 23:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 18:32 [PATCH 1/1] kernel/nsproxy.c: Improving a snippet of code Raphael S.Carvalho
2013-02-27 20:09 ` Serge Hallyn
2013-02-27 23:14   ` Eric W. Biederman

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