X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmic.c;h=3e31889fe83f560d89a09ce20df0d26c55d95dc6;hb=43954e07f30d05b2da8319749400c9bf4d01c23c;hp=570da51bcfd56c20296effdd64e570e3ff9eb6b9;hpb=21077b074c468a41dbd60baad691ebc7f2991d43;p=collectd.git diff --git a/src/mic.c b/src/mic.c index 570da51b..3e31889f 100644 --- a/src/mic.c +++ b/src/mic.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "utils_ignorelist.h" @@ -213,9 +214,8 @@ static void mic_submit_temp(int micnumber, const char *type, gauge_t val) static int mic_read_temps(int mic) { size_t num_therms = STATIC_ARRAY_SIZE(therm_ids); - size_t j; - for (j = 0; j < num_therms; j++) { + for (size_t j = 0; j < num_therms; j++) { U32 status; U32 temp_buffer; U32 buffer_size = (U32)sizeof(temp_buffer); @@ -286,8 +286,7 @@ static int mic_read_cpu(int mic) } if (show_cpu_cores) { - int j; - for (j = 0; j < core_util.core; j++) { + for (int j = 0; j < core_util.core; j++) { mic_submit_cpu(mic, "user", j, core_jiffs[j].user); mic_submit_cpu(mic, "sys", j, core_jiffs[j].sys); mic_submit_cpu(mic, "nice", j, core_jiffs[j].nice); @@ -356,12 +355,11 @@ static int mic_read_power(int mic) static int mic_read (void) { - int i; U32 ret; int error; error=0; - for (i=0;i