Skip to content

Commit 620e08c

Browse files
ikegami-tigaw
authored andcommitted
nbft: enable nbft-plugin.c build without json-c dependencies checking
Only build json print codes with CONFIG_JSONC build option instead. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 936383f commit 620e08c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

plugins/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
if json_c_dep.found()
44
sources += [
5-
'plugins/nbft/nbft-plugin.c',
65
'plugins/netapp/netapp-nvme.c',
76
'plugins/nvidia/nvidia-nvme.c',
87
'plugins/scaleflux/sfx-nvme.c',
@@ -27,6 +26,7 @@ sources += [
2726
'plugins/intel/intel-nvme.c',
2827
'plugins/memblaze/memblaze-nvme.c',
2928
'plugins/micron/micron-nvme.c',
29+
'plugins/nbft/nbft-plugin.c',
3030
'plugins/shannon/shannon-nvme.c',
3131
'plugins/toshiba/toshiba-nvme.c',
3232
'plugins/transcend/transcend-nvme.c',

plugins/nbft/nbft-plugin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static char *mac_addr_to_string(unsigned char mac_addr[6])
4747
return mac_string;
4848
}
4949

50+
#ifdef CONFIG_JSONC
5051
static json_object *hfi_to_json(struct nbft_info_hfi *hfi)
5152
{
5253
struct json_object *hfi_json;
@@ -348,6 +349,9 @@ static int json_show_nbfts(struct list_head *nbft_list, bool show_subsys,
348349
json_free_object(nbft_json_array);
349350
return -ENOMEM;
350351
}
352+
#else /* CONFIG_JSONC */
353+
#define json_show_nbfts(nbft_list, show_subsys, show_hfi, show_discovery) -EINVAL
354+
#endif /* CONFIG_JSONC */
351355

352356
static void print_nbft_hfi_info(struct nbft_info *nbft)
353357
{

0 commit comments

Comments
 (0)