From 3d749249492cb9f63bb2ba900b34032ac343c311 Mon Sep 17 00:00:00 2001 From: Martin George Date: Tue, 11 Feb 2025 21:37:24 +0530 Subject: [PATCH] nvme: make -v output consistent with -H output for nvme get-property Current -v verbose output of the nvme get-property command is a no-op. So update it to make it consistent with the -H human-readable output for this same command. Signed-off-by: Martin George --- nvme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nvme.c b/nvme.c index 7e894704..41eb0a1c 100644 --- a/nvme.c +++ b/nvme.c @@ -6107,6 +6107,7 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; __u64 value; int err; + nvme_print_flags_t flags = NORMAL; struct get_reg_config cfg = { .offset = -1, @@ -6127,9 +6128,12 @@ static int get_property(int argc, char **argv, struct command *cmd, struct plugi return -EINVAL; } + if (cfg.human_readable || argconfig_parse_seen(opts, "verbose")) + flags |= VERBOSE; + err = nvme_get_single_property(dev_fd(dev), &cfg, &value); if (!err) - nvme_show_single_property(cfg.offset, value, cfg.human_readable); + nvme_show_single_property(cfg.offset, value, flags); return err; } -- 2.50.1