ACK: [PATCH] cpu: cpufreq: reduce scope of variable 'i'
ivanhu
ivan.hu at canonical.com
Thu Aug 18 02:21:51 UTC 2016
On 2016年08月17日 18:13, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Minor change to fix cppcheck style warnings, no functional change
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/cpu/cpufreq/cpufreq.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 7216364..2d30c2a 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -749,7 +749,7 @@ static int parse_cpu_info(fwts_framework *fw,
> {
> char *end, path[PATH_MAX+1], *str, *tmp;
> struct stat statbuf;
> - int i, rc;
> + int rc;
>
> strcpy(cpu->sysfs_path, dir->d_name);
> cpu->idx = strtoul(cpu->sysfs_path + strlen("cpu"), &end, 10);
> @@ -783,7 +783,9 @@ static int parse_cpu_info(fwts_framework *fw,
>
> /* cpu driver like intel_pstate has no scaling_available_frequencies */
> if (str != NULL) {
> - for (tmp = str, i = 0; ; tmp = NULL) {
> + int i = 0;
> +
> + for (tmp = str; ; tmp = NULL) {
> char *tok = strtok(tmp, " ");
> if (!tok)
> break;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list