From patchwork Tue Aug 14 11:24:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 957441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41qVcX6gGLz9s7c; Tue, 14 Aug 2018 21:24:43 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fpXRF-0007jG-EZ; Tue, 14 Aug 2018 11:24:37 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fpXRE-0007is-An for fwts-devel@lists.ubuntu.com; Tue, 14 Aug 2018 11:24:36 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fpXRE-0001y0-1e; Tue, 14 Aug 2018 11:24:36 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 01/13] lib: fwts_cpu: make found a boolean Date: Tue, 14 Aug 2018 12:24:23 +0100 Message-Id: <20180814112435.22166-2-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814112435.22166-1-colin.king@canonical.com> References: <20180814112435.22166-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King Variable found should be a boolean rather than an int Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- 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);