From: Thomas Weißschuh Date: Sat, 15 Jan 2022 08:54:08 +0000 (+0100) Subject: lspcu: Print dummy modelname if none present X-Git-Tag: v2.38-rc1~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f592b88d0cd965e20ca1f492cadb3b8c8fd48a40;p=thirdparty%2Futil-linux.git lspcu: Print dummy modelname if none present The logic in print_summary_cputype() starts a new hierarchy level under the CPUs "Model name" entry. If the model is unknown the hierarchy level will be skipped. This is visually confusing in the human-readable version and changes the schema of the JSON tree. --- diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index e11b2f42f0..32f989e381 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -859,8 +859,7 @@ print_summary_cputype(struct lscpu_cxt *cxt, struct libscols_table *tb, struct libscols_line *sec) { - if (ct->modelname) - sec = add_summary_s(tb, sec, _("Model name:"), ct->modelname); + sec = add_summary_s(tb, sec, _("Model name:"), ct->modelname ? ct->modelname : "-"); if (ct->bios_modelname) add_summary_s(tb, sec, _("BIOS Model name:"), ct->bios_modelname); if (ct->bios_family)