devlink: fix json binary printout of arrays
Subsystems (2)
PATCH 1/1 devlink: fix json binary printout of arrays
From: Jiri Pirko <[email protected]>
The binary is printed out into json as an array of byte values. Add missing (removed) start and end array json calls.
Fixes f359942a25d3 ("devlink: Remove enclosing array brackets binary print with json format")
Signed-off-by Jiri Pirko <[email protected]>
--- devlink/devlink.c | 4 ++++ 1 file changed, 4 insertions(+)
devlink/devlink.c +4 -0
@@ -1930,6 +1930,8 @@ static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len) {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]);
@@ -1941,6 +1943,8 @@ static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len) }if (!dl->json_output && !is_binary_eol (i))__pr_out_newline (); +if (dl->json_output) +jsonw_end_array (dl->jw); }static void pr_out_str_value (struct dl *dl,const char *value)
Signature · 1 line
2.21.0
Quoted 7 lines · Wed, Oct 09, 2019 at 10:32:32AM CEST, [email protected] wrote:
From: Jiri Pirko <[email protected]>
The binary is printed out into json as an array of byte values. Add missing (removed) start and end array json calls.
Fixes f359942a25d3 ("devlink: Remove enclosing array brackets binary print with json format")Signed-off-by Jiri Pirko <[email protected]>
Please scratch this patch.