]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_diskstats.c
improvements identified via static code analysis with cppcheck
[netdata.git] / src / proc_diskstats.c
index 7ff857785edeba9cb240160b31e8e5bb766ed2e1..52712c25a24ed96a0cabab4b571469e27580bdf6 100644 (file)
@@ -480,7 +480,6 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
     if(unlikely(!ff)) return 0; // we return 0, so that we will retry to open it next time
 
     uint32_t lines = procfile_lines(ff), l;
-    uint32_t words;
 
     // this is smart enough not to reload it every time
     mountinfo_reload(0);
@@ -500,7 +499,7 @@ int do_proc_diskstats(int update_every, unsigned long long dt) {
                             last_writes = 0, last_writesectors = 0, last_writems = 0,
                             last_busy_ms = 0;
 
-        words = procfile_linewords(ff, l);
+        uint32_t words = procfile_linewords(ff, l);
         if(unlikely(words < 14)) continue;
 
         major           = strtoul(procfile_lineword(ff, l, 0), NULL, 10);