From: Jim Warner Date: Thu, 14 Apr 2022 05:00:00 +0000 (-0500) Subject: library: eliminate redundant assignment, api X-Git-Tag: v4.0.1rc1~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af443770e3ecc57e6bacad025150f3888ca24e6c;p=procps-ng library: eliminate redundant assignment, api 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 --- diff --git a/proc/meminfo.c b/proc/meminfo.c index e304f0f5..f28b0b11 100644 --- a/proc/meminfo.c +++ b/proc/meminfo.c @@ -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