parasite: simplify syscall check

Submitted by Laurent Dufour on July 19, 2016, 4:30 p.m.

Details

Message ID 1468945807-3827-1-git-send-email-ldufour@linux.vnet.ibm.com
State Accepted
Series "parasite: simplify syscall check"
Commit 206625ebd595bc4c843739c147eac84218a16afc
Headers show

Commit Message

Laurent Dufour July 19, 2016, 4:30 p.m.
In is_required_syscall() req_sysnr is set according to the native mode
so we can check the syscall number directly against it.

No functional change expected.

Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
---
 criu/parasite-syscall.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 75c645f154c2..824037c0b4df 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -1043,12 +1043,8 @@  static inline int is_required_syscall(user_regs_struct_t *regs, pid_t pid,
 
 	pr_debug("%d (%s) is going to execute the syscall %lu, required is %d\n",
 		pid, mode, REG_SYSCALL_NR(*regs), req_sysnr);
-	if (user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr))
-		return true;
-	if (!user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr_compat))
-		return true;
 
-	return false;
+	return (REG_SYSCALL_NR(*regs) == req_sysnr);
 }
 /*
  * Trap tasks on the exit from the specified syscall

Comments

Dmitry Safonov July 19, 2016, 4:34 p.m.
On 07/19/2016 07:30 PM, Laurent Dufour wrote:
> In is_required_syscall() req_sysnr is set according to the native mode
> so we can check the syscall number directly against it.
>
> No functional change expected.
>
> Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>

Thanks!
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Pavel Emelianov July 21, 2016, 5:01 p.m.
Applied, thanks