From patchwork Tue Jul 19 16:30:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: parasite: simplify syscall check From: Laurent Dufour X-Patchwork-Id: 1060 Message-Id: <1468945807-3827-1-git-send-email-ldufour@linux.vnet.ibm.com> To: criu@openvz.org Cc: Dmitry Safonov , xemul@parallels.com Date: Tue, 19 Jul 2016 18:30:07 +0200 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 Signed-off-by: Laurent Dufour Reviewed-by: Dmitry Safonov --- criu/parasite-syscall.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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