From: Jim Warner Date: Fri, 11 Jan 2019 06:00:00 +0000 (-0600) Subject: library: remove one needless function call, api X-Git-Tag: v4.0.0~444 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68d7f7a673aee38238d054efe2fe207db245e3c5;p=procps-ng library: remove one needless function call, api This small change is an outgrowth of the research into the bug represented by that merge request shown below. With the master branch, a real buglet was subsequently addressed. In this newlib branch, no bug existed since the API relies solely on just cpus reflected in (and parsed from) the kernel's /proc/stat pseudo file. [ since that procps_stat_new() priming read about to ] [ be performed will value info->cpus.total, there is ] [ no need to separately invoke a procps_cpu_count(). ] Reference(s): https://gitlab.com/procps-ng/procps/merge_requests/82 Signed-off-by: Jim Warner --- diff --git a/proc/stat.c b/proc/stat.c index 524dfe07..a8f8e24b 100644 --- a/proc/stat.c +++ b/proc/stat.c @@ -877,7 +877,6 @@ PROCPS_EXPORT int procps_stat_new ( p->results.cpus = &p->cpus.result; p->results.nodes = &p->nodes.result; - p->cpus.total = procps_cpu_count(); // these 3 are for reap, sharing a single set of items p->cpu_summary.items = p->cpus.fetch.items = p->nodes.fetch.items = &p->reap_items;