]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/power turbostat: Fix names matching
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Sat, 8 Feb 2025 10:55:42 +0000 (12:55 +0200)
committerLen Brown <len.brown@intel.com>
Sun, 9 Feb 2025 16:56:00 +0000 (10:56 -0600)
commit5132681dcd96b2a8c357b6e5d93e9876924bb80b
treeea1d924ed54d8f31fdf29785b336253310a0dac1
parentb312d880fb462d4759396950865ec914de9d253c
tools/power turbostat: Fix names matching

Fix the 'find_msrp_by_name()' function which returns incorrect matches for
cases like this:

s1 = "C1-";
find_msrp_by_name(head, s1);

Inside 'find_msrp_by_name()':
...
s2 = "C1"
if !(strcnmp(s1, s2, len(s2)))
// Incorrect match!
return mp;

Full strings should be match istead. Switch to 'strcmp()' to fix the problem.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c