From: Dmitry V. Levin Date: Thu, 2 Jul 2015 22:27:51 +0000 (+0000) Subject: ioctl: simplify ioctl_decode signature X-Git-Tag: v4.11~487 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=802c942a36df694d83e8f707e5c07527a53c04d0;p=strace ioctl: simplify ioctl_decode signature * ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters. (sys_ioctl): Update callers. --- diff --git a/ioctl.c b/ioctl.c index 9b6ea166..305d27d3 100644 --- a/ioctl.c +++ b/ioctl.c @@ -222,8 +222,11 @@ ioctl_decode_command_number(const unsigned int code) } static int -ioctl_decode(struct tcb *tcp, unsigned int code, long arg) +ioctl_decode(struct tcb *tcp) { + const unsigned int code = tcp->u_arg[1]; + const long arg = tcp->u_arg[2]; + switch (_IOC_TYPE(code)) { #if defined(ALPHA) || defined(POWERPC) case 'f': case 't': case 'T': @@ -281,10 +284,10 @@ SYS_FUNC(ioctl) ioctl_print_code(tcp->u_arg[1]); } } - ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); + ioctl_decode(tcp); } else { - int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); + int ret = ioctl_decode(tcp); if (!ret) tprintf(", %#lx", tcp->u_arg[2]); else