]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins: Use type bool for OPT_FLAG
authorDaniel Wagner <dwagner@suse.de>
Tue, 29 Mar 2022 09:58:29 +0000 (11:58 +0200)
committerDaniel Wagner <dwagner@suse.de>
Tue, 29 Mar 2022 11:05:29 +0000 (13:05 +0200)
We switched the arg parser over to using the bool type for
OPT_FLAG. Update all OPT_FLAG user to new type.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
plugins/intel/intel-nvme.c
plugins/memblaze/memblaze-nvme.c
plugins/scaleflux/sfx-nvme.c
plugins/seagate/seagate-nvme.c
plugins/shannon/shannon-nvme.c
plugins/wdc/wdc-nvme.c
plugins/ymtc/ymtc-nvme.c
plugins/zns/zns.c

index 0ccff45dd712d999d48f0c717a374d9f0cb4e412..d80b18cb3f99e9e31056748470230275dac133f8 100644 (file)
@@ -347,8 +347,8 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
 
        struct config {
                __u32 namespace_id;
-               int   raw_binary;
-               int   json;
+               bool  raw_binary;
+               bool  json;
        };
 
        struct config cfg = {
@@ -389,7 +389,7 @@ static int get_market_log(int argc, char **argv, struct command *cmd, struct plu
        int err, fd;
 
        struct config {
-               int  raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
@@ -449,7 +449,7 @@ static int get_temp_stats_log(int argc, char **argv, struct command *cmd, struct
        const char *desc = "Get Temperature Statistics log and show it.";
        const char *raw = "dump output in binary format";
        struct config {
-               int  raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
@@ -1032,9 +1032,9 @@ static int get_lat_stats_log(int argc, char **argv, struct command *cmd, struct
        const char *write = "Get write statistics (read default)";
 
        struct config {
-               int  raw_binary;
-               int json;
-               int  write;
+               bool raw_binary;
+               bool json;
+               bool write;
        };
 
        struct config cfg = {
@@ -1637,12 +1637,12 @@ static int set_lat_stats_thresholds(int argc, char **argv,
        __u32 result;
 
        struct config {
-               int write;
+               bool write;
                char *bucket_thresholds;
        };
 
        struct config cfg = {
-               .write = 0,
+               .write = false,
                .bucket_thresholds = "",
        };
 
index 232b8600d59d23222be2fd93d5ef4b9bbb677b9b..9096a4790590d5a57607ced5e3ab3a1cf7702868 100644 (file)
@@ -439,7 +439,7 @@ static int mb_get_additional_smart_log(int argc, char **argv, struct command *cm
        const char *raw = "dump output in binary format";
        struct config {
                __u32 namespace_id;
-               int   raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
@@ -531,7 +531,7 @@ static int mb_set_powermanager_status(int argc, char **argv, struct command *cmd
     struct config {
         __u32 feature_id;
         __u32 value;
-        int   save;
+        bool  save;
     };
 
     struct config cfg = {
@@ -1022,7 +1022,7 @@ static int mb_lat_stats_log_print(int argc, char **argv, struct command *cmd, st
     const char *write = "Get write statistics (read default)";
 
     struct config {
-        int  write;
+        bool  write;
     };
     struct config cfg = {
         .write = 0,
index cb04847c52b022cf079d1f53ffe58d1d9645b4cc..a6aaad5fa44550af8af0eb47a7a87de6d243f184 100644 (file)
@@ -338,8 +338,8 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
        const char *json= "Dump output in json format";
        struct config {
                __u32 namespace_id;
-               int   raw_binary;
-               int   json;
+               bool  raw_binary;
+               bool  json;
        };
 
        struct config cfg = {
@@ -422,8 +422,8 @@ static int get_lat_stats_log(int argc, char **argv, struct command *cmd, struct
        const char *raw = "dump output in binary format";
        const char *write = "Get write statistics (read default)";
        struct config {
-               int  raw_binary;
-               int  write;
+               bool raw_binary;
+               bool write;
        };
 
        struct config cfg = {
@@ -607,8 +607,8 @@ static int query_cap_info(int argc, char **argv, struct command *cmd, struct plu
        const char *raw = "dump output in binary format";
        const char *json= "Dump output in json format";
        struct config {
-               int   raw_binary;
-               int   json;
+               bool  raw_binary;
+               bool  json;
        };
        struct config cfg;
 
@@ -736,9 +736,9 @@ static int change_cap(int argc, char **argv, struct command *cmd, struct plugin
        struct config {
                __u64 cap_in_byte;
                __u32 capacity_in_gb;
-               int   raw_binary;
-               int   json;
-               int   force;
+               bool  raw_binary;
+               bool  json;
+               bool  force;
        };
 
        struct config cfg = {
@@ -853,7 +853,7 @@ static int sfx_set_feature(int argc, char **argv, struct command *cmd, struct pl
                __u32 namespace_id;
                __u32 feature_id;
                __u32 value;
-               __u32 force;
+               bool  force;
        };
        struct config cfg = {
                .namespace_id = 1,
index e71e51c5e2cc0fed53529eac9f67685779dc9f7a..5f6ce90b0ffcc5b65020bd61fe973377672f6714 100644 (file)
@@ -1025,7 +1025,7 @@ static int vs_clr_pcie_correctable_errs(int argc, char **argv, struct command *c
        __u32 result;
 
        struct config {
-               int   save;
+               bool   save;
        };
 
        struct config cfg = {
@@ -1068,7 +1068,7 @@ static int get_host_tele(int argc, char **argv, struct command *cmd, struct plug
        struct config {
                __u32 namespace_id;
                __u32 log_id;
-               int   raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
@@ -1182,7 +1182,7 @@ static int get_ctrl_tele(int argc, char **argv, struct command *cmd, struct plug
 
        struct config {
                __u32 namespace_id;
-               int   raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
index 0f4b68407278f8fdf24d85a7e5e0c03f2fc47c20..d79b119d55ccc6e7f918694255db62765c827cd3 100644 (file)
@@ -123,7 +123,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
        const char *raw = "dump output in binary format";
        struct config {
                __u32 namespace_id;
-               int   raw_binary;
+               bool  raw_binary;
        };
 
        struct config cfg = {
@@ -180,8 +180,8 @@ static int get_additional_feature(int argc, char **argv, struct command *cmd, st
                __u8  sel;
                __u32 cdw11;
                __u32 data_len;
-               int  raw_binary;
-               int  human_readable;
+               bool  raw_binary;
+               bool  human_readable;
        };
 
        struct config cfg = {
@@ -293,7 +293,7 @@ static int set_additional_feature(int argc, char **argv, struct command *cmd, st
                __u32 feature_id;
                __u32 value;
                __u32 data_len;
-               int   save;
+               bool  save;
        };
 
        struct config cfg = {
index c7bd0a47802c0bfe2e56484d729c8cde709c233c..5c60bccd635cfd5d8d76f9035590c8b78ad92824 100644 (file)
@@ -2975,7 +2975,7 @@ static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command
                __u64 file_size;
                __u64 offset;
                char *type;
-               int verbose;
+               bool verbose;
        };
 
        struct config cfg = {
@@ -2985,7 +2985,7 @@ static int wdc_vs_internal_fw_log(int argc, char **argv, struct command *command
                .file_size = 0,
                .offset = 0,
                .type = NULL,
-               .verbose = 0,
+               .verbose = false,
        };
 
        OPT_ARGS(opts) = {
@@ -6338,15 +6338,15 @@ static int wdc_vs_telemetry_controller_option(int argc, char **argv, struct comm
 
 
        struct config {
-               int disable;
-               int enable;
-               int status;
+               bool disable;
+               bool enable;
+               bool status;
        };
 
        struct config cfg = {
-               .disable = 0,
-               .enable = 0,
-               .status = 0,
+               .disable = false,
+               .enable = false,
+               .status = false,
        };
 
        OPT_ARGS(opts) = {
index e8637bf9fc733b641330c162f4fe16642554124e..dd5f00456d0ee16a4fbb874da66ff88294e9f2be 100644 (file)
@@ -112,7 +112,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
     const char *raw = "dump output in binary format";
     struct config {
         __u32 namespace_id;
-        int   raw_binary;
+        bool  raw_binary;
     };
 
     struct config cfg = {
index 19227a484e5d2305a6e267c93c1836ba7cbf7aac..56e53afeb56fdb6c6bf84f76dd52619994f5d253 100644 (file)
@@ -171,8 +171,8 @@ static int id_ns(int argc, char **argv, struct command *cmd, struct plugin *plug
        struct config {
                char *output_format;
                __u32 namespace_id;
-               int human_readable;
-               int vendor_specific;
+               bool human_readable;
+               bool vendor_specific;
        };
 
        struct config cfg = {
@@ -350,7 +350,7 @@ static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plu
        struct config {
                __u64   zslba;
                __u32   namespace_id;
-               __u8    zsaso;
+               bool    zsaso;
                bool    select_all;
                __u8    zsa;
                int     data_len;
@@ -857,7 +857,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi
                __u32 namespace_id;
                int   num_descs;
                int   state;
-               int   verbose;
+               bool  verbose;
                bool  extended;
                bool  partial;
        };
@@ -1041,15 +1041,15 @@ static int zone_append(int argc, char **argv, struct command *cmd, struct plugin
                __u64  zslba;
                __u64  data_size;
                __u64  metadata_size;
-               int    limited_retry;
-               int    fua;
+               bool   limited_retry;
+               bool   fua;
                __u32  namespace_id;
                __u32  ref_tag;
                __u16  lbat;
                __u16  lbatm;
                __u8   prinfo;
-               int    piremap;
-               int   latency;
+               bool   piremap;
+               bool   latency;
        };
 
        struct config cfg = {};