From d78c8f31529601cecee2c29dfba635cab7b51a7a Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 29 Mar 2022 11:58:29 +0200 Subject: [PATCH] plugins: Use type bool for OPT_FLAG 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 --- plugins/intel/intel-nvme.c | 18 +++++++++--------- plugins/memblaze/memblaze-nvme.c | 6 +++--- plugins/scaleflux/sfx-nvme.c | 20 ++++++++++---------- plugins/seagate/seagate-nvme.c | 6 +++--- plugins/shannon/shannon-nvme.c | 8 ++++---- plugins/wdc/wdc-nvme.c | 16 ++++++++-------- plugins/ymtc/ymtc-nvme.c | 2 +- plugins/zns/zns.c | 16 ++++++++-------- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/plugins/intel/intel-nvme.c b/plugins/intel/intel-nvme.c index 0ccff45d..d80b18cb 100644 --- a/plugins/intel/intel-nvme.c +++ b/plugins/intel/intel-nvme.c @@ -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 = "", }; diff --git a/plugins/memblaze/memblaze-nvme.c b/plugins/memblaze/memblaze-nvme.c index 232b8600..9096a479 100644 --- a/plugins/memblaze/memblaze-nvme.c +++ b/plugins/memblaze/memblaze-nvme.c @@ -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, diff --git a/plugins/scaleflux/sfx-nvme.c b/plugins/scaleflux/sfx-nvme.c index cb04847c..a6aaad5f 100644 --- a/plugins/scaleflux/sfx-nvme.c +++ b/plugins/scaleflux/sfx-nvme.c @@ -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, diff --git a/plugins/seagate/seagate-nvme.c b/plugins/seagate/seagate-nvme.c index e71e51c5..5f6ce90b 100644 --- a/plugins/seagate/seagate-nvme.c +++ b/plugins/seagate/seagate-nvme.c @@ -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 = { diff --git a/plugins/shannon/shannon-nvme.c b/plugins/shannon/shannon-nvme.c index 0f4b6840..d79b119d 100644 --- a/plugins/shannon/shannon-nvme.c +++ b/plugins/shannon/shannon-nvme.c @@ -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 = { diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index c7bd0a47..5c60bccd 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -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) = { diff --git a/plugins/ymtc/ymtc-nvme.c b/plugins/ymtc/ymtc-nvme.c index e8637bf9..dd5f0045 100644 --- a/plugins/ymtc/ymtc-nvme.c +++ b/plugins/ymtc/ymtc-nvme.c @@ -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 = { diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 19227a48..56e53afe 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -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 = {}; -- 2.50.1