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

Colin King colin.king at canonical.com
Tue Jan 23 12:16:41 UTC 2018


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);
 
-- 
2.15.1




More information about the fwts-devel mailing list