From: Eugene Syromyatnikov Date: Sat, 10 Mar 2018 04:38:10 +0000 (+0100) Subject: Remove addflags X-Git-Tag: v4.22~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3744bc73f7a92c3f9f85105f979848b2145b8a41;p=strace Remove addflags It has only single user and implementation of xlat styles for it would lead to lots of code duplication. * defs.h (addflags): Remove declaration. * mem.c (print_mmap_flags): Convert addflags call into printflags64 with non-zeroeness flags check. * xlat.c (addflags): Remove. --- diff --git a/defs.h b/defs.h index abe81c33..8415d6b3 100644 --- a/defs.h +++ b/defs.h @@ -582,7 +582,6 @@ extern int printargs(struct tcb *); extern int printargs_u(struct tcb *); extern int printargs_d(struct tcb *); -extern void addflags(const struct xlat *, uint64_t); extern int printflags_ex(uint64_t, const char *, const struct xlat *, ...) ATTRIBUTE_SENTINEL; extern const char *sprintflags(const char *, const struct xlat *, uint64_t); diff --git a/mem.c b/mem.c index aeb4cae2..f79d67cd 100644 --- a/mem.c +++ b/mem.c @@ -73,7 +73,10 @@ print_mmap_flags(kernel_ulong_t flags) const unsigned int hugetlb_value = flags & mask; flags &= ~mask; - addflags(mmap_flags, flags); + if (flags) { + tprints("|"); + printflags64(mmap_flags, flags, NULL); + } if (hugetlb_value) tprintf("|%u<str; xlat++) { - if (xlat->val && (flags & xlat->val) == xlat->val) { - tprintf("|%s", xlat->str); - flags &= ~xlat->val; - } - } - if (flags) { - tprintf("|%#" PRIx64, flags); - } -} - /* * Interpret `xlat' as an array of flags. * Print to static string the entries whose bits are on in `flags'