]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: make code more readable [lgtm scan]
authorKarel Zak <kzak@redhat.com>
Tue, 3 Dec 2019 13:35:43 +0000 (14:35 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Dec 2019 13:35:43 +0000 (14:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index 4f1ab47e90380ad58ca56fd6a6fea57e43807f0e..c1ccbb8949eb21bbe4f9307d38c48e4d0bdbdbda 100644 (file)
@@ -944,10 +944,11 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod)
                        if (fd)
                                fclose(fd);
                }
-       } else if (read_hypervisor_powerpc(desc) > 0) {}
-
+       } else if (read_hypervisor_powerpc(desc) > 0) {
+               /* read_hypervisor_powerpc() sets all necessary stuff to @desc */
+               ;
        /* Xen para-virt or dom0 */
-       else if (ul_path_access(desc->procfs, F_OK, "xen") == 0) {
+       else if (ul_path_access(desc->procfs, F_OK, "xen") == 0) {
                int dom0 = 0;
 
                fd = ul_path_fopen(desc->procfs, "r", "xen/capabilities");