ACK: [PATCH 20/46] cpu: microcode: reduce scope of variables

IvanHu ivan.hu at canonical.com
Thu Jan 15 07:33:04 UTC 2015


On 01/14/2015 03:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> cppcheck is picking up some minor style issues which can
> be easily fixed:
>
> [src/cpu/microcode/microcode.c:203]:
> 	(style) The scope of the variable 'path' can be reduced.
> [src/cpu/microcode/microcode.c:204]:
> 	(style) The scope of the variable 'data' can be reduced.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/cpu/microcode/microcode.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/cpu/microcode/microcode.c b/src/cpu/microcode/microcode.c
> index d493168..b541b87 100644
> --- a/src/cpu/microcode/microcode.c
> +++ b/src/cpu/microcode/microcode.c
> @@ -200,13 +200,13 @@ static int microcode_test1(fwts_framework *fw)
>
>   	/* Scan and check */
>   	while ((entry = readdir(dir)) != NULL) {
> -		char path[PATH_MAX];
> -		char *data;
> -
>   	        if (entry &&
>   		    (strlen(entry->d_name) > 3) &&
>   		    (strncmp(entry->d_name,"cpu", 3) == 0) &&
>   		    (isdigit(entry->d_name[3]))) {
> +			char path[PATH_MAX];
> +			char *data;
> +
>   	        	snprintf(path, sizeof(path),
>   				SYS_CPU_PATH "/%s/microcode/version",
>   				entry->d_name);
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list