]> git.baikalelectronics.ru Git - kernel.git/commit
cpupower: bench: parse.c: Fix several minor errors
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Tue, 29 Jul 2014 16:12:19 +0000 (18:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Jul 2014 23:57:13 +0000 (01:57 +0200)
commitb4a536299d6862750c10f3cef6914b02d1dadf2c
tree1cb090f8c033e0f4fd221f0bd84bec4e65dd3fc2
parent786edb31bcc44840816d154d14dcdc5a059a97ac
cpupower: bench: parse.c: Fix several minor errors

Resolved several minor errors in prepare_config() and made some additional improvements.
Earlier, the risk of file stream that was not closed. Misuse of strncpy, and the use of strncmp with strlen that makes it pointless.
I also check that sscanf has been successful, otherwise continue to the next line. And minimized the use of magic numbers.

This was found using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
tools/power/cpupower/bench/parse.c