Add a capability of printing port handles for arrays in non-JSON format
in devlink-health manner.
Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
open_json_object(buf);
}
} else {
- pr_out("%s:", buf);
+ if (array) {
+ if (should_arr_last_port_handle_end(dl, bus_name, dev_name, port_index))
+ __pr_out_indent_dec();
+ if (should_arr_last_port_handle_start(dl, bus_name,
+ dev_name, port_index)) {
+ pr_out("%s:", buf);
+ __pr_out_newline();
+ __pr_out_indent_inc();
+ arr_last_port_handle_set(dl, bus_name, dev_name, port_index);
+ }
+ } else {
+ pr_out("%s:", buf);
+ }
}
}