mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 07:04:10 +08:00
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>
This commit is contained in:
parent
033312336d
commit
e13da9a1db
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user