From 39530d489a986515651632dc8c102dd8eaa72ea6 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Wed, 4 Apr 2018 14:12:08 +0200 Subject: [PATCH] fcntl: replace combinations of xlookup and printxval with printxvals After all, that's what printxvals for. * fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for printing value with multiple xlat tables as constant sources. --- fcntl.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/fcntl.c b/fcntl.c index a42489bd..3abce7fd 100644 --- a/fcntl.c +++ b/fcntl.c @@ -198,17 +198,13 @@ SYS_FUNC(fcntl) printfd(tcp, tcp->u_arg[0]); tprints(", "); const unsigned int cmd = tcp->u_arg[1]; - const char *str = xlookup(fcntlcmds, cmd); - if (str) { - tprints(str); - } else { - /* - * fcntl syscall does not recognize these - * constants, but we would like to show them - * for better debugging experience. - */ - printxval(fcntl64cmds, cmd, "F_???"); - } + + /* + * fcntl syscall does not recognize fcntl64 command constants, + * but we would like to show them for better debugging + * experience. + */ + printxvals(cmd, "F_???", fcntlcmds, fcntl64cmds, NULL); } return print_fcntl(tcp); } @@ -219,12 +215,7 @@ SYS_FUNC(fcntl64) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - const char *str = xlookup(fcntl64cmds, cmd); - if (str) { - tprints(str); - } else { - printxval(fcntlcmds, cmd, "F_???"); - } + printxvals(cmd, "F_???", fcntl64cmds, fcntlcmds, NULL); } switch (cmd) { case F_SETLK64: -- 2.40.0