Skip to content

Commit

Permalink
dapustor: avoid sprinkling ifdefs
Browse files Browse the repository at this point in the history
Use empty json functions instead without json.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Dec 21, 2024
1 parent 1b7ebe9 commit 3cc2197
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions plugins/dapustor/dapustor-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions util/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3cc2197

Please sign in to comment.