ACK: [PATCH] opal: reserve_mem: remove unused variable 'i' and move scope of variable 'value'

ivanhu ivan.hu at canonical.com
Wed Jan 24 07:09:25 UTC 2018



On 01/23/2018 08:16 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Minor code cleanups; variable i is assiged but never read, so it can be removed.
> Move the scope of variable value into the while loop.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/opal/reserv_mem.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
> index f31e9652..4683f73c 100644
> --- a/src/opal/reserv_mem.c
> +++ b/src/opal/reserv_mem.c
> @@ -57,9 +57,7 @@ static int get_config(fwts_framework *fw,
>   {
>   	FILE *file;
>   	char *p;
> -	uint64_t value;
>   	char line[MAXBUF];
> -	int i = 0;
>   
>   	file = fopen(filename, "r");
>   	if (!file) {
> @@ -71,6 +69,7 @@ static int get_config(fwts_framework *fw,
>   
>   	while (fgets(line, sizeof(line), file) != NULL) {
>   		char *cfline;
> +		uint64_t value;
>   
>   		cfline = strstr((char *)line, DELIM);
>   		cfline = cfline + strlen(DELIM);
> @@ -82,8 +81,6 @@ static int get_config(fwts_framework *fw,
>   			configstruct->occ_common = value;
>   		else if (strstr(line, "slw-image"))
>   			configstruct->slw = value;
> -
> -		i++;
>   	}
>   	fclose(file);
>   
> 

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



More information about the fwts-devel mailing list