]> granicus.if.org Git - procps-ng/commitdiff
library: eliminate redundant assignment, <meminfo> api
authorJim Warner <james.warner@comcast.net>
Thu, 14 Apr 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 17 Apr 2022 00:43:19 +0000 (10:43 +1000)
With the memset to zero of a 'new' meminfo_data struct
near the beginning of the meminfo_read_failed function
there's never a need to later set anything in it to 0.

[ who knows, our patch might even coax opensuse into ]
[ reevaluating that 4.0.0 'overflow' guy named below ]

Reference(s):
. overflow: 'procps-ng-4.0.0-integer-overflow.patch'

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

index e304f0f500f79d2cd5900cf666ed964ff108af93..f28b0b117aebc4d420c5c7665ccf90011ad63e85 100644 (file)
@@ -716,8 +716,6 @@ static int meminfo_read_failed (
 
     if (mHr(SwapFree) < mHr(SwapTotal))
         mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree);
-    else
-        mHr(derived_swap_used) = 0;
 
     return 0;
  #undef mHr