[PATCH 01/13] lib: fwts_cpu: make found a boolean

Colin King colin.king at canonical.com
Tue Aug 14 11:24:23 UTC 2018


From: Colin Ian King <colin.king at canonical.com>

Variable found should be a boolean rather than an int

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_cpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
index 6806418c..e79f5b0a 100644
--- a/src/lib/src/fwts_cpu.c
+++ b/src/lib/src/fwts_cpu.c
@@ -107,7 +107,8 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu)
 	FILE *fp;
 	char buffer[1024];
 	fwts_cpuinfo_x86 *cpu;
-	int cpu_num = -1, found = 0;
+	int cpu_num = -1;
+	bool found = false;
 
 	if ((cpu = (fwts_cpuinfo_x86*)calloc(1, sizeof(fwts_cpuinfo_x86))) == NULL)
 		return NULL;
@@ -138,7 +139,7 @@ fwts_cpuinfo_x86 *fwts_cpu_get_info(int which_cpu)
 				continue;
 		}
 
-		found = 1;
+		found = true;
 
 		if (!strncmp(buffer, "vendor_id", 9)) {
 			cpu->vendor_id = strdup(ptr);
-- 
2.17.1




More information about the fwts-devel mailing list