From 1b5a3dca4fa72e539b9b73b8897b016ada1256e3 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Sat, 21 Dec 2024 22:19:40 +0900 Subject: [PATCH] dapustor: avoid sprinkling ifdefs Use empty json functions instead without json. Signed-off-by: Tokunori Ikegami --- plugins/dapustor/dapustor-nvme.c | 4 ---- util/json.h | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/dapustor/dapustor-nvme.c b/plugins/dapustor/dapustor-nvme.c index 8dc12d55..b98b1a04 100644 --- a/plugins/dapustor/dapustor-nvme.c +++ b/plugins/dapustor/dapustor-nvme.c @@ -96,7 +96,6 @@ struct nvme_extended_additional_smart_log { struct nvme_additional_smart_log_item inflight_write_io_cmd; }; -#ifdef CONFIG_JSONC static void show_dapustor_add_smart_log_jsn(struct nvme_additional_smart_log *smart, struct json_object *dev_stats) { @@ -349,9 +348,6 @@ static void show_dapustor_smart_log_jsn(struct nvme_additional_smart_log *smart, json_print_object(root, NULL); json_free_object(root); } -#else /* CONFIG_JSONC */ -#define show_dapustor_smart_log_jsn(smart, ext_smart, nsid, devname, has_ext) -#endif /* CONFIG_JSONC */ static void show_dapustor_add_smart_log(struct nvme_additional_smart_log *smart) { diff --git a/util/json.h b/util/json.h index 94f0d32d..7d2208ff 100644 --- a/util/json.h +++ b/util/json.h @@ -61,6 +61,7 @@ struct json_object; #define json_object_add_value_uint64(o, k, v) ((void)(v)) #define json_object_add_value_uint128(o, k, v) #define json_object_add_value_double(o, k, v) +#define json_object_add_value_float(o, k, v) #define json_object_add_value_array(o, k, v) ((void)(v)) #define json_object_add_value_object(o, k, v) ((void)(v)) #define json_array_add_value_object(o, k) ((void)(k)) -- 2.50.1