Keep pr_out_binary_value function only for printing. Inner relations
like array grouping should be done outside the function.
Fixes: 844a61764c6f ("devlink: Add helper functions for name and value separately")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
{
int i = 0;
- if (dl->json_output)
- jsonw_start_array(dl->jw);
-
while (i < len) {
if (dl->json_output)
jsonw_printf(dl->jw, "%d", data[i]);
if (!dl->json_output && is_binary_eol(i))
__pr_out_newline();
}
- if (dl->json_output)
- jsonw_end_array(dl->jw);
- else if (!is_binary_eol(i))
+ if (!dl->json_output && !is_binary_eol(i))
__pr_out_newline();
}