]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
netapp: avoid sprinkling ifdefs
authorTokunori Ikegami <ikegami.t@gmail.com>
Sat, 21 Dec 2024 13:16:34 +0000 (22:16 +0900)
committerDaniel Wagner <wagi@monom.org>
Fri, 3 Jan 2025 09:21:08 +0000 (10:21 +0100)
Use empty json functions instead without json.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
plugins/netapp/netapp-nvme.c

index 884731279a0445149d3e35df77e3d6bc8e0a45a5..1acc97d437ecfab1458432889933f66886992312 100644 (file)
@@ -248,7 +248,6 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath,
        }
 }
 
-#ifdef CONFIG_JSONC
 static void netapp_smdevice_json(struct json_object *devices, char *devname,
                char *arrayname, char *volname, int nsid, char *nguid,
                char *ctrl, char *astate, char *version, unsigned long long lba,
@@ -294,7 +293,6 @@ static void netapp_ontapdevice_json(struct json_object *devices, char *devname,
 
        json_array_add_value_object(devices, device_attrs);
 }
-#endif /* CONFIG_JSONC */
 
 static void netapp_smdevices_print_verbose(struct smdevice_info *devices,
                int count, int format, const char *devname)
@@ -442,7 +440,6 @@ static void netapp_smdevices_print_regular(struct smdevice_info *devices,
        }
 }
 
-#ifdef CONFIG_JSONC
 static void netapp_smdevices_print_json(struct smdevice_info *devices,
                int count, const char *devname)
 {
@@ -511,9 +508,6 @@ out:
        printf("\n");
        json_free_object(root);
 }
-#else /* CONFIG_JSONC */
-#define netapp_smdevices_print_json(devices, count, devname)
-#endif /* CONFIG_JSONC */
 
 static void netapp_ontapdevices_print_verbose(struct ontapdevice_info *devices,
                int count, int format, const char *devname)
@@ -629,7 +623,6 @@ static void netapp_ontapdevices_print_regular(struct ontapdevice_info *devices,
        }
 }
 
-#ifdef CONFIG_JSONC
 static void netapp_ontapdevices_print_json(struct ontapdevice_info *devices,
                int count, const char *devname)
 {
@@ -686,9 +679,6 @@ out:
        printf("\n");
        json_free_object(root);
 }
-#else /* CONFIG_JSONC */
-#define netapp_ontapdevices_print_json(devices, count, devname)
-#endif /* CONFIG_JSONC */
 
 static int nvme_get_ontap_c2_log(int fd, __u32 nsid, void *buf, __u32 buflen)
 {