]> granicus.if.org Git - procps-ng/commitdiff
library: normalized 'extents_free_all' use across APIs
authorJim Warner <james.warner@comcast.net>
Sat, 13 Feb 2021 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Thu, 18 Feb 2021 07:35:32 +0000 (18:35 +1100)
With the way those 'extents_free_all' guys were coded,
there's no real need to check for a NULL this->extents
before calling 'em. That's how <stat> already does it.

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

index a9d2c593ee7abc6a9df781636fa6063f8afd339f..c47dfad7d4de20c55f3c8ef3ea25aef3e9971837 100644 (file)
@@ -691,8 +691,7 @@ static int diskstats_stacks_reconfig_maybe (
         memcpy(this->items, items, sizeof(enum diskstats_item) * numitems);
         this->items[numitems] = DISKSTATS_logical_end;
         this->numitems = numitems + 1;
-        if (this->extents)
-            diskstats_extents_free_all(this);
+        diskstats_extents_free_all(this);
         return 1;
     }
     return 0;
index 73aa232e367d3490f34e0805eb72775f80b69716..4a6d7ed56b9edb0409b4aa92b5ee19b3393b4ee7 100644 (file)
@@ -716,8 +716,7 @@ static int slabinfo_stacks_reconfig_maybe (
         memcpy(this->items, items, sizeof(enum slabinfo_item) * numitems);
         this->items[numitems] = SLABINFO_logical_end;
         this->numitems = numitems + 1;
-        if (this->extents)
-            slabinfo_extents_free_all(this);
+        slabinfo_extents_free_all(this);
         return 1;
     }
     return 0;