@@ -4666,17 +4666,19 @@ static int filter_out_flags(int status)
46664666 return status & (NVME_VAL (SCT ) | NVME_VAL (SC ));
46674667}
46684668
4669- static void get_feature_id_print (struct feat_cfg cfg , int err , __u32 result , void * buf )
4669+ static void get_feature_id_print (struct feat_cfg cfg , int err , __u32 result ,
4670+ void * buf , nvme_print_flags_t flags )
46704671{
46714672 int status = filter_out_flags (err );
4673+ int verbose = flags & VERBOSE ;
46724674 enum nvme_status_type type = NVME_STATUS_TYPE_NVME ;
46734675
46744676 if (!err ) {
46754677 if (!cfg .raw_binary || !buf ) {
46764678 nvme_feature_show (cfg .feature_id , cfg .sel , result );
46774679 if (NVME_CHECK (cfg .sel , GET_FEATURES_SEL , SUPPORTED ))
46784680 nvme_show_select_result (cfg .feature_id , result );
4679- else if (cfg . human_readable )
4681+ else if (verbose )
46804682 nvme_feature_show_fields (cfg .feature_id , result , buf );
46814683 else if (buf )
46824684 d (buf , cfg .data_len , 16 , 1 );
@@ -4692,7 +4694,8 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result, voi
46924694 }
46934695}
46944696
4695- static int get_feature_id_changed (struct nvme_dev * dev , struct feat_cfg cfg )
4697+ static int get_feature_id_changed (struct nvme_dev * dev , struct feat_cfg cfg ,
4698+ nvme_print_flags_t flags )
46964699{
46974700 int err ;
46984701 int err_def = 0 ;
@@ -4713,12 +4716,13 @@ static int get_feature_id_changed(struct nvme_dev *dev, struct feat_cfg cfg)
47134716
47144717 if (err || !cfg .changed || err_def || result != result_def ||
47154718 (buf && buf_def && !strcmp (buf , buf_def )))
4716- get_feature_id_print (cfg , err , result , buf );
4719+ get_feature_id_print (cfg , err , result , buf , flags );
47174720
47184721 return err ;
47194722}
47204723
4721- static int get_feature_ids (struct nvme_dev * dev , struct feat_cfg cfg )
4724+ static int get_feature_ids (struct nvme_dev * dev , struct feat_cfg cfg ,
4725+ nvme_print_flags_t flags )
47224726{
47234727 int err = 0 ;
47244728 int i ;
@@ -4732,7 +4736,7 @@ static int get_feature_ids(struct nvme_dev *dev, struct feat_cfg cfg)
47324736
47334737 for (i = cfg .feature_id ; i < feat_max ; i ++ , feat_num ++ ) {
47344738 cfg .feature_id = i ;
4735- err = get_feature_id_changed (dev , cfg );
4739+ err = get_feature_id_changed (dev , cfg , flags );
47364740 if (!err )
47374741 continue ;
47384742 status = filter_out_flags (err );
@@ -4768,6 +4772,7 @@ static int get_feature(int argc, char **argv, struct command *cmd,
47684772 const char * cdw11 = "feature specific dword 11" ;
47694773 const char * human_readable = "show feature in readable format" ;
47704774 const char * changed = "show feature changed" ;
4775+ nvme_print_flags_t flags = NORMAL ;
47714776
47724777 _cleanup_nvme_dev_ struct nvme_dev * dev = NULL ;
47734778 int err ;
@@ -4819,9 +4824,12 @@ static int get_feature(int argc, char **argv, struct command *cmd,
48194824 return -1 ;
48204825 }
48214826
4827+ if (cfg .human_readable || argconfig_parse_seen (opts , "verbose" ))
4828+ flags |= VERBOSE ;
4829+
48224830 nvme_show_init ();
48234831
4824- err = get_feature_ids (dev , cfg );
4832+ err = get_feature_ids (dev , cfg , flags );
48254833
48264834 nvme_show_finish ();
48274835
0 commit comments