diff --git a/plugins/intel/intel-nvme.c b/plugins/intel/intel-nvme.c index e5c896c2c3..342cf09b25 100644 --- a/plugins/intel/intel-nvme.c +++ b/plugins/intel/intel-nvme.c @@ -138,7 +138,6 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl return __id_ctrl(argc, argv, cmd, plugin, intel_id_ctrl); } -#ifdef CONFIG_JSONC static void show_intel_smart_log_jsn(struct nvme_additional_smart_log *smart, unsigned int nsid, const char *devname) { @@ -261,9 +260,6 @@ static void show_intel_smart_log_jsn(struct nvme_additional_smart_log *smart, json_print_object(root, NULL); json_free_object(root); } -#else /* CONFIG_JSONC */ -#define show_intel_smart_log_jsn(smart, nsid, devname) -#endif /* CONFIG_JSONC */ static char *id_to_key(__u8 id) { @@ -693,7 +689,6 @@ static int lat_stats_log_scale(int i) * "type" : "write" or "read", * "values" : { */ -#ifdef CONFIG_JSONC static void lat_stats_make_json_root( struct json_object *root, struct json_object *bucket_list, int write) @@ -825,7 +820,6 @@ static void json_lat_stats_4_0(struct intel_lat_stats *stats, json_print_object(root, NULL); json_free_object(root); } -#endif /* CONFIG_JSONC */ static void show_lat_stats_3_0(struct intel_lat_stats *stats) { @@ -856,7 +850,6 @@ static void show_lat_stats_4_0(struct intel_lat_stats *stats) } } -#ifdef CONFIG_JSONC static void json_lat_stats_v1000_0(struct optane_lat_stats *stats, int write) { int i; @@ -905,7 +898,6 @@ static void json_lat_stats_v1000_0(struct optane_lat_stats *stats, int write) json_free_object(root); } -#endif /* CONFIG_JSONC */ static void show_lat_stats_v1000_0(struct optane_lat_stats *stats, int write) { @@ -939,7 +931,6 @@ static void show_lat_stats_v1000_0(struct optane_lat_stats *stats, int write) } -#ifdef CONFIG_JSONC static void json_lat_stats(int write) { switch (media_version[MEDIA_MAJOR_IDX]) { @@ -980,9 +971,6 @@ static void json_lat_stats(int write) } printf("\n"); } -#else /* CONFIG_JSONC */ -#define json_lat_stats(write) -#endif /* CONFIG_JSONC */ static void print_dash_separator(int count) { diff --git a/util/json.h b/util/json.h index 8a974addda..94f0d32d07 100644 --- a/util/json.h +++ b/util/json.h @@ -9,7 +9,6 @@ /* Wrappers around json-c's API */ #define json_create_object(o) json_object_new_object(o) -#define json_create_array(a) json_object_new_array(a) #define json_free_object(o) json_object_put(o) #define json_free_array(a) json_object_put(a) #define json_object_add_value_uint(o, k, v) \ @@ -56,7 +55,6 @@ struct json_object; #define json_object_add_value_string(o, k, v) #define json_create_object(o) NULL -#define json_create_array(a) NULL #define json_free_object(o) ((void)(o)) #define json_object_add_value_uint(o, k, v) ((void)(v)) #define json_object_add_value_int(o, k, v) ((void)(v)) @@ -67,6 +65,9 @@ struct json_object; #define json_object_add_value_object(o, k, v) ((void)(v)) #define json_array_add_value_object(o, k) ((void)(k)) #define json_print_object(o, u) ((void)(o)) +#define json_object_new_array(a) NULL #define json_object_array_add(o, k) ((void)(k)) #endif /* CONFIG_JSONC */ +#define json_create_array(a) json_object_new_array(a) + #endif /* __JSON__H */