qed: Fix static checker warning
[linux/fpc-iii.git] / tools / perf / trace / beauty / waitid_options.c
blob8465281a093de02aa3e7e026e35eeb688634929a
1 // SPDX-License-Identifier: GPL-2.0
2 #include <sys/types.h>
3 #include <sys/wait.h>
5 static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size,
6 struct syscall_arg *arg)
8 int printed = 0, options = arg->val;
10 #define P_OPTION(n) \
11 if (options & W##n) { \
12 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
13 options &= ~W##n; \
16 P_OPTION(NOHANG);
17 P_OPTION(UNTRACED);
18 P_OPTION(CONTINUED);
19 #undef P_OPTION
21 if (options)
22 printed += scnprintf(bf + printed, size - printed, "%s%#x", printed ? "|" : "", options);
24 return printed;
27 #define SCA_WAITID_OPTIONS syscall_arg__scnprintf_waitid_options