summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2022-11-03 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2022-11-03 08:00:00 +0000
commitfcb3ebc9dc8c8a887ac38ce923f0dd9553281a52 (patch)
treeb7e27b137236781fb1cb3f7ff92c3be255f50de0
parent51670be035bd4d96784c28f846fce2a6aaf5dd76 (diff)
downloadstrace-fcb3ebc9dc8c8a887ac38ce923f0dd9553281a52.tar.gz
v4l2: use tprint_value_changed() helper from print_fields.h
* src/v4l2.c (print_v4l2_streamparm, print_v4l2_tuner, print_v4l2_ext_controls): Use tprint_struct_next, tprint_struct_begin, tprint_struct_end, and tprint_value_changed.
-rw-r--r--src/v4l2.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/v4l2.c b/src/v4l2.c
index 754fbf93e..7ac85b8fe 100644
--- a/src/v4l2.c
+++ b/src/v4l2.c
@@ -708,7 +708,13 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg,
tprint_struct_end();
return RVAL_IOCTL_DECODED;
}
- tprints(is_get ? ", " : "} => {");
+ if (is_get) {
+ tprint_struct_next();
+ } else {
+ tprint_struct_end();
+ tprint_value_changed();
+ tprint_struct_begin();
+ }
}
if (s.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
@@ -905,7 +911,13 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
tprint_struct_end();
return RVAL_IOCTL_DECODED;
}
- tprints(is_get ? ", " : "} => {");
+ if (is_get) {
+ tprint_struct_next();
+ } else {
+ tprint_struct_end();
+ tprint_value_changed();
+ tprint_struct_begin();
+ }
}
PRINT_FIELD_CSTRING(c, name);
@@ -1184,7 +1196,13 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
tprint_struct_end();
return RVAL_IOCTL_DECODED;
}
- tprints(is_get ? ", " : "} => {");
+ if (is_get) {
+ tprint_struct_next();
+ } else {
+ tprint_struct_end();
+ tprint_value_changed();
+ tprint_struct_begin();
+ }
}
tprints_field_name("controls");