kernel/nsproxy.c: Improving a snippet of code.
PATCH 1/1 kernel/nsproxy.c: Improving a snippet of code.
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 <[email protected]>
--- kernel/nsproxy.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/nsproxy.c +2 -1
@@ -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; }
Signature · 1 line
1.7.2.5
Quoted 4 lines · 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 <[email protected]>
Acked-by Serge E. Hallyn <[email protected]>
Quoted 21 lines
--- kernel/nsproxy.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)kernel/nsproxy.c +2
-1@@ -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; }Signature · 1 line
1.7.2.5
Quoted 7 lines · Serge Hallyn
Quoted 4 lines · 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 <[email protected]>Acked-by Serge E. Hallyn <[email protected]>
Thanks all. Added to my development tree. I will push it out in my for-next branch after 3.9-rc1 is released.
Eric