]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: always create Architecture section
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 30 Oct 2022 15:10:31 +0000 (16:10 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 1 Nov 2022 00:15:38 +0000 (01:15 +0100)
cxt->arch can never be NULL.

sys-utils/lscpu.c

index f6135158737dc658455ad8122751c4d1be914f40..85ef5abcbbaaa3e6e8c1407655cc25cacb36f4e9 100644 (file)
@@ -949,7 +949,7 @@ static void print_summary(struct lscpu_cxt *cxt)
        char field[256];
        size_t i = 0;
        struct libscols_table *tb;
-       struct libscols_line *sec = NULL;
+       struct libscols_line *sec;
        int hdr_caches = 0;
 
        scols_init_debug(0);
@@ -981,9 +981,8 @@ static void print_summary(struct lscpu_cxt *cxt)
        ct = lscpu_cputype_get_default(cxt);
 
        /* Section: architecture */
-       if (cxt->arch)
-               sec = add_summary_s(tb, NULL, _("Architecture:"), cxt->arch->name);
-       if (cxt->arch && (cxt->arch->bit32 || cxt->arch->bit64)) {
+       sec = add_summary_s(tb, NULL, _("Architecture:"), cxt->arch->name);
+       if (cxt->arch->bit32 || cxt->arch->bit64) {
                char buf[32], *p = buf;
 
                if (cxt->arch->bit32) {