]> granicus.if.org Git - procps-ng/commitdiff
library: tweak support of p-core/e-core identification
authorJim Warner <james.warner@comcast.net>
Sat, 1 Oct 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 3 Oct 2022 23:57:34 +0000 (10:57 +1100)
Wow, after this we'll eliminate one 'jmp' instruction!

[ plus we can also save a single precious whitespace ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
library/stat.c

index c7cdef5296a6461d2bdbad96c8ff923cf310ddf7..60d7364458c9c16715f5e1d67e9861b72fa2adef 100644 (file)
@@ -468,11 +468,10 @@ static void stat_cores_check (
     }
     if (p_core) {
         core = info->cores;
-        while (core) {
+        do {
             if (core->thread_2 == VACANT)
                 core->type = E_CORE;
-            core = core->next;
-        }
+        } while ((core = core->next));
     }
 } // end: stat_cores_check
 
@@ -530,7 +529,7 @@ static int stat_cores_verify (
       { static int fake_core;
         if (a_cpu > ECORE_BEGIN) {
             if (!fake_core) fake_core = a_core + 1;
-             a_core = fake_core++;
+            a_core = fake_core++;
       } }
 #endif
         if (!stat_core_add(info, a_core, a_cpu)) {