]> granicus.if.org Git - strace/commitdiff
ioctl: simplify ioctl_decode signature
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 2 Jul 2015 22:27:51 +0000 (22:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 2 Jul 2015 22:32:21 +0000 (22:32 +0000)
* ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters.
(sys_ioctl): Update callers.

ioctl.c

diff --git a/ioctl.c b/ioctl.c
index 9b6ea166a2552648b6bf0efa8ec9193cdd67cc55..305d27d36da55ed75b2b239d9d2e64839a5be942 100644 (file)
--- 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