On Thu, Jan 14, 2016 at 05:26:54PM +0100, Peter Krempa wrote:
Use 'ret' for return variable name, clarify use of
'param_idx' and avoid
unnecessary 'success' label. No functional changes.
---
src/util/vircgroup.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 78f519c..2fc0276 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -3239,34 +3240,33 @@ virCgroupGetPercpuStats(virCgroupPtr group,
goto cleanup;
}
- if (nvcpupids == 0 || param_idx + 1 >= nparams)
- goto success;
/* return percpu vcputime in index 1 */
- param_idx++;
-
- if (VIR_ALLOC_N(sum_cpu_time, need_cpus) < 0)
- goto cleanup;
- if (virCgroupGetPercpuVcpuSum(group, nvcpupids, sum_cpu_time, need_cpus,
- cpumap) < 0)
- goto cleanup;
+ param_idx = 1;
This changes the return value from 1 to 2 in cases when nvcpupids == 0
or the function was called with nparams == 1.
Jan