@@ -248,6 +248,7 @@ static void netapp_get_ontap_labels(char *vsname, char *nspath,
248248 }
249249}
250250
251+ #ifdef CONFIG_JSONC
251252static void netapp_smdevice_json (struct json_object * devices , char * devname ,
252253 char * arrayname , char * volname , int nsid , char * nguid ,
253254 char * ctrl , char * astate , char * version , unsigned long long lba ,
@@ -293,6 +294,7 @@ static void netapp_ontapdevice_json(struct json_object *devices, char *devname,
293294
294295 json_array_add_value_object (devices , device_attrs );
295296}
297+ #endif /* CONFIG_JSONC */
296298
297299static void netapp_smdevices_print_verbose (struct smdevice_info * devices ,
298300 int count , int format , const char * devname )
@@ -440,6 +442,7 @@ static void netapp_smdevices_print_regular(struct smdevice_info *devices,
440442 }
441443}
442444
445+ #ifdef CONFIG_JSONC
443446static void netapp_smdevices_print_json (struct smdevice_info * devices ,
444447 int count , const char * devname )
445448{
@@ -508,6 +511,9 @@ static void netapp_smdevices_print_json(struct smdevice_info *devices,
508511 printf ("\n" );
509512 json_free_object (root );
510513}
514+ #else /* CONFIG_JSONC */
515+ #define netapp_smdevices_print_json (devices , count , devname )
516+ #endif /* CONFIG_JSONC */
511517
512518static void netapp_ontapdevices_print_verbose (struct ontapdevice_info * devices ,
513519 int count , int format , const char * devname )
@@ -623,6 +629,7 @@ static void netapp_ontapdevices_print_regular(struct ontapdevice_info *devices,
623629 }
624630}
625631
632+ #ifdef CONFIG_JSONC
626633static void netapp_ontapdevices_print_json (struct ontapdevice_info * devices ,
627634 int count , const char * devname )
628635{
@@ -679,6 +686,9 @@ static void netapp_ontapdevices_print_json(struct ontapdevice_info *devices,
679686 printf ("\n" );
680687 json_free_object (root );
681688}
689+ #else /* CONFIG_JSONC */
690+ #define netapp_ontapdevices_print_json (devices , count , devname )
691+ #endif /* CONFIG_JSONC */
682692
683693static int nvme_get_ontap_c2_log (int fd , __u32 nsid , void * buf , __u32 buflen )
684694{
@@ -829,8 +839,10 @@ static int netapp_output_format(char *format)
829839 return - EINVAL ;
830840 if (!strcmp (format , "normal" ))
831841 return NNORMAL ;
842+ #ifdef CONFIG_JSONC
832843 if (!strcmp (format , "json" ))
833844 return NJSON ;
845+ #endif /* CONFIG_JSONC */
834846 if (!strcmp (format , "column" ))
835847 return NCOLUMN ;
836848 return - EINVAL ;
0 commit comments