From 44ffbf0adc37a04c9644913bd67b63f56142558b Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Sat, 15 Oct 2016 02:57:47 +0300 Subject: [PATCH] process_vm: remove syserror check for iovec printing This check had been done by print_array inside tprint_iov anyway. * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for printing local_iov; do not check for syserror, provide decode_iov parameter to tprint_iov{,_upto} based on its value instead. --- process_vm.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/process_vm.c b/process_vm.c index 0a9dcd21..a61713ae 100644 --- a/process_vm.c +++ b/process_vm.c @@ -35,21 +35,14 @@ SYS_FUNC(process_vm_readv) tprintf("%ld, ", tcp->u_arg[0]); } else { /* arg 2: local iov */ - if (syserror(tcp)) { - printaddr(tcp->u_arg[1]); - } else { - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], - IOV_DECODE_STR); - } + tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], + syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR, + tcp->u_rval); /* arg 3: local iovcnt */ tprintf(", %lu, ", tcp->u_arg[2]); /* arg 4: remote iov */ - if (syserror(tcp)) { - printaddr(tcp->u_arg[3]); - } else { - tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], - IOV_DECODE_ADDR); - } + tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], + IOV_DECODE_ADDR); /* arg 5: remote iovcnt */ /* arg 6: flags */ tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]); -- 2.40.0