--- components/cpu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/cpu.c b/components/cpu.c index a001d14..646cdad 100644 --- a/components/cpu.c +++ b/components/cpu.c _AT_@ -28,10 +28,8 @@ cpu_perc(void) &a[3], &a[4], &a[5], &a[6]) != 7) { return NULL; } - if (!valid) { + if (!valid) valid = 1; - return NULL; - } perc = 100 * ((b[0]+b[1]+b[2]+b[5]+b[6]) - (a[0]+a[1]+a[2]+a[5]+a[6])) / ((b[0]+b[1]+b[2]+b[3]+b[4]+b[5]+b[6]) - (a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6])); _AT_@ -52,10 +50,8 @@ cpu_iowait(void) &a[3], &a[4], &a[5], &a[6]) != 7) { return NULL; } - if (!valid) { + if (!valid) valid = 1; - return NULL; - } perc = 100 * ((b[4]) - (a[4])) / ((b[0]+b[1]+b[2]+b[3]+b[4]+b[5]+b[6]) - (a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6])); -- 2.14.3Received on Mon Apr 16 2018 - 16:28:51 CEST
This archive was generated by hypermail 2.3.0 : Mon Apr 16 2018 - 16:36:24 CEST