]> granicus.if.org Git - procps-ng/commitdiff
top: just trade an assignement for a manifest constant
authorJim Warner <james.warner@comcast.net>
Wed, 23 Feb 2022 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Sun, 27 Feb 2022 10:27:02 +0000 (21:27 +1100)
The assignment was originally created to reduce length
of one line of code (i.e. for readability). But we can
achieve this objective without adding executable code.

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

index f3b9d13d7aa33224ceca726543a62d4055935b4f..df3019d06a7caed11d5a58b4dab04933817ec309 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -3339,10 +3339,10 @@ static inline int osel_matched (const WIN_t *q, FLG_t enu, const char *str) {
          * No matter what *they* say, we handle the really really BIG and
          * IMPORTANT stuff upon which all those lessor functions depend! */
 static void before (char *me) {
+ #define doALL STAT_REAP_NUMA_NODES_TOO
    struct sigaction sa;
    int i, rc;
    int linux_version_code = procps_linux_version();
-   enum stat_reap_type which = STAT_REAP_NUMA_NODES_TOO;
 
    atexit(close_stdout);
 
@@ -3378,7 +3378,7 @@ static void before (char *me) {
    if ((rc = procps_stat_new(&Stat_ctx)))
       Restrict_some = Cpu_cnt = 1;
    else {
-      if (!(Stat_reap = procps_stat_reap(Stat_ctx, which, Stat_items, MAXTBL(Stat_items))))
+      if (!(Stat_reap = procps_stat_reap(Stat_ctx, doALL, Stat_items, MAXTBL(Stat_items))))
          error_exit(fmtmk(N_fmt(LIB_errorcpu_fmt), __LINE__, strerror(errno)));
 #ifndef PRETEND0NUMA
       Numa_node_tot = Stat_reap->numa->total;
@@ -3467,6 +3467,7 @@ static void before (char *me) {
       }
       sigaction(i, &sa, NULL);
    }
+ #undef doALL
 } // end: before