From: Daniel Wagner Date: Wed, 26 Jul 2023 13:44:34 +0000 (+0200) Subject: nvme-print: Fix show-topolocy for ctrls X-Git-Tag: v2.6~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7c965a0482fdd792314accae8e1b00f1f81e9812;p=users%2Fsagi%2Fnvme-cli.git nvme-print: Fix show-topolocy for ctrls Depending on the ranking command line argument we are supposed to show the topology order by namespaces or ctrls. Fixes: 1d583b7856db ("nvme-print-stdout: Refactor stdout print code to use print_ops") Signed-off-by: Daniel Wagner --- diff --git a/nvme-print.c b/nvme-print.c index 4b977c11..286e4d55 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -1016,7 +1016,11 @@ void nvme_show_topology(nvme_root_t r, enum nvme_cli_topo_ranking ranking, enum nvme_print_flags flags) { - nvme_print(topology_namespace, flags, r); + if (ranking == NVME_CLI_TOPO_NAMESPACE) { + nvme_print(topology_namespace, flags, r); + } else { + nvme_print(topology_ctrl, flags, r); + } } void nvme_show_message(bool error, const char *msg, ...)