summaryrefslogtreecommitdiff
path: root/tools/power
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2022-04-26 16:10:24 +0300
committerLen Brown <len.brown@intel.com>2022-07-28 21:23:25 +0300
commite13da9a1dbe4c97431286660ec35eceb50003bb3 (patch)
treee64d89256a499b1300b604ad689e60e9f8e5e220 /tools/power
parent033312336d67a2ca9b5ff4ad35e5dfd99042d2a3 (diff)
downloadlinux-e13da9a1dbe4c97431286660ec35eceb50003bb3.tar.xz
tools/power turbostat: replace strncmp with single character compare
Using strncmp for a single character comparison is overly complicated, just use a simpler single character comparison instead. Also stops static analyzers (such as cppcheck) from complaining about strncmp on non-null terminated strings. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/x86/turbostat/turbostat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 318e971c55a1..4593f8d5b617 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -2976,7 +2976,7 @@ int get_thread_siblings(struct cpu_topology *thiscpu)
}
}
}
- } while (!strncmp(&character, ",", 1));
+ } while (character == ',');
fclose(filep);
return CPU_COUNT_S(size, thiscpu->put_ids);