From: Tokunori Ikegami Date: Thu, 2 Nov 2023 18:25:35 +0000 (+0900) Subject: nvme-print-json: Replase json_array_add_value_string() to array_add_str() X-Git-Tag: v2.7~64 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1c10887b9d917366517f538b0075b2666b90f131;p=users%2Fsagi%2Fnvme-cli.git nvme-print-json: Replase json_array_add_value_string() to array_add_str() Signed-off-by: Tokunori Ikegami --- diff --git a/nvme-print-json.c b/nvme-print-json.c index c3548842..24164ec9 100644 --- a/nvme-print-json.c +++ b/nvme-print-json.c @@ -20,6 +20,7 @@ #define MS500_TO_SEC(time) ((time) / 2) #define array_add_obj json_array_add_value_object +#define array_add_str json_array_add_value_string #define obj_add_array json_object_add_value_array #define obj_add_int json_object_add_value_int @@ -691,11 +692,11 @@ static void json_select_result(__u32 result) struct json_object *feature = json_create_array(); if (result & 0x1) - json_array_add_value_string(feature, "saveable"); + array_add_str(feature, "saveable"); if (result & 0x2) - json_array_add_value_string(feature, "per-namespace"); + array_add_str(feature, "per-namespace"); if (result & 0x4) - json_array_add_value_string(feature, "changeable"); + array_add_str(feature, "changeable"); root_add_array("Feature", feature); @@ -2199,14 +2200,14 @@ static void d_json(unsigned char *buf, int len, int width, int group, struct jso for (i = 0; i < len; i++) { ascii[i % width] = (buf[i] >= '!' && buf[i] <= '~') ? buf[i] : '.'; if (!((i + 1) % width)) { - json_array_add_value_string(array, ascii); + array_add_str(array, ascii); memset(ascii, 0, sizeof(ascii)); } } if (strlen(ascii)) { ascii[i % width + 1] = '\0'; - json_array_add_value_string(array, ascii); + array_add_str(array, ascii); } }