From fc67d3ad9a2903cc33e5cdaedaad51dd86a42236 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 24 Dec 2023 08:57:49 +0100 Subject: Adding upstream version 2.7.1. Signed-off-by: Daniel Baumann --- plugins/huawei/huawei-nvme.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/huawei/huawei-nvme.c') diff --git a/plugins/huawei/huawei-nvme.c b/plugins/huawei/huawei-nvme.c index 82e190f..0272dea 100644 --- a/plugins/huawei/huawei-nvme.c +++ b/plugins/huawei/huawei-nvme.c @@ -296,7 +296,7 @@ static int huawei_list(int argc, char **argv, struct command *command, struct huawei_list_item *list_items; unsigned int i, n, ret; unsigned int huawei_num = 0; - int fmt; + enum nvme_print_flags fmt; const char *desc = "Retrieve basic information for the given huawei device"; struct config { char *output_format; @@ -315,9 +315,9 @@ static int huawei_list(int argc, char **argv, struct command *command, if (ret) return ret; - fmt = validate_output_format(cfg.output_format); - if (fmt != JSON && fmt != NORMAL) - return -EINVAL; + ret = validate_output_format(cfg.output_format, &fmt); + if (ret < 0 || (fmt != JSON && fmt != NORMAL)) + return ret; n = scandir("/dev", &devices, nvme_namespace_filter, alphasort); if (n <= 0) -- cgit v1.2.3