Skip to content

Commit 95ead9e

Browse files
ikegami-tigaw
authored andcommitted
ocp: build ocp-nvme.c and ocp-telemetry-decode.c without json
Still ocp-telemetry-decode.c includes json code so check CONFIG_JSON. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent c6749a2 commit 95ead9e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plugins/ocp/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
sources += [
22
'plugins/ocp/ocp-utils.c',
3+
'plugins/ocp/ocp-nvme.c',
34
'plugins/ocp/ocp-clear-features.c',
45
'plugins/ocp/ocp-smart-extended-log.c',
56
'plugins/ocp/ocp-fw-activation-history.c',
7+
'plugins/ocp/ocp-telemetry-decode.c',
68
'plugins/ocp/ocp-hardware-component-log.c',
79
'plugins/ocp/ocp-print.c',
810
'plugins/ocp/ocp-print-stdout.c',
@@ -11,8 +13,6 @@ sources += [
1113

1214
if json_c_dep.found()
1315
sources += [
14-
'plugins/ocp/ocp-nvme.c',
15-
'plugins/ocp/ocp-telemetry-decode.c',
1616
'plugins/ocp/ocp-print-json.c',
1717
]
1818
endif

plugins/ocp/ocp-telemetry-decode.c

+4
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ struct request_data smart_extended[] = {
422422
{ "Log page GUID", 16 }
423423
};
424424

425+
#ifdef CONFIG_JSONC
425426
void json_add_formatted_u32_str(struct json_object *pobject, const char *msg, unsigned int pdata)
426427
{
427428
char data_str[70] = { 0 };
@@ -443,6 +444,7 @@ void json_add_formatted_var_size_str(struct json_object *pobject, const char *ms
443444

444445
json_object_add_value_string(pobject, msg, description_str);
445446
}
447+
#endif /* CONFIG_JSONC */
446448

447449
int get_telemetry_das_offset_and_size(
448450
struct nvme_ocp_telemetry_common_header *ptelemetry_common_header,
@@ -636,6 +638,7 @@ int parse_ocp_telemetry_string_log(int event_fifo_num, int identifier, int debug
636638
return 0;
637639
}
638640

641+
#ifdef CONFIG_JSONC
639642
void parse_time_stamp_event(struct nvme_ocp_telemetry_event_descriptor *pevent_descriptor,
640643
struct json_object *pevent_descriptor_obj, __u8 *pevent_specific_data,
641644
struct json_object *pevent_fifos_object, FILE *fp)
@@ -1695,3 +1698,4 @@ int print_ocp_telemetry_json(struct ocp_telemetry_parse_options *options)
16951698

16961699
return status;
16971700
}
1701+
#endif /* CONFIG_JSONC */

0 commit comments

Comments
 (0)