From patchwork Wed Sep 22 09:51:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1531146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=RnTDgfG4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HDtpy4Lw6z9sW4 for ; Wed, 22 Sep 2021 19:51:22 +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 1mSyuN-0007sG-H6; Wed, 22 Sep 2021 09:51:19 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mSyuL-0007sA-UL for fwts-devel@lists.ubuntu.com; Wed, 22 Sep 2021 09:51:17 +0000 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id AAFF43F0AA; Wed, 22 Sep 2021 09:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632304277; bh=l65psZ89IIN+s+DdUA1SFF4DFMW+FQzhY1GspIq2xeg=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type; b=RnTDgfG40FRKY0vJ+KrBD3sfi3t2cEuuy9pg4VC2I0Zujzm5HIMFtUQv4iS2Y5Nan vKcpyswqkV56jbs6Frks5e+wT12oUHvvv5oxRLIZufG8E4IoeexBXo+ufuv2Xu35L/ 7ydamzjTI8+wTy+mcWL5tsHFPpLt3uJab7Oh4AifSZrGphwp8oVl5bvF8LT8KZhMLa HzHpCeWEPzz9D1QIpwVeaL76zN9ZD18mvBiJe9tz1ce/f9cD9fAvoT3j5nJmHQVUUM Zlk54VqBM+OIuDHR99KCWbIgfR9s20qXb14PtxsgysKIFVbcSoWyQDkSfogJPsAVTV g5BR1aAotSMrQ== From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] opal: clean up some coding style issues Date: Wed, 22 Sep 2021 10:51:17 +0100 Message-Id: <20210922095117.160289-1-colin.king@canonical.com> X-Mailer: git-send-email 2.32.0 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 Ensure code keeps to the informal fwts coding style, minor coding style clean-ups. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/opal/cpu_info.c | 20 ++++++++++---------- src/opal/mem_info.c | 4 ++-- src/opal/mtd_info.c | 1 - src/opal/pci_info.c | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c index a3e46239..a7022d24 100644 --- a/src/opal/cpu_info.c +++ b/src/opal/cpu_info.c @@ -63,7 +63,7 @@ static int get_xscom_property(fwts_framework *fw, property, prop_buf, prop_len)) { - failures ++; + failures++; } fwts_passed(fw, "OPAL CPU Info Property of" @@ -73,7 +73,7 @@ static int get_xscom_property(fwts_framework *fw, my_path, prop_buf); } else { - failures ++; + failures++; fwts_log_nl(fw); fwts_failed(fw, LOG_LEVEL_CRITICAL, @@ -95,7 +95,7 @@ static int get_xscom_property(fwts_framework *fw, property, my_path); } } else { - failures ++; + failures++; fwts_log_nl(fw); fwts_failed(fw, LOG_LEVEL_CRITICAL, "OPAL CPU Info", @@ -105,7 +105,7 @@ static int get_xscom_property(fwts_framework *fw, my_path, property); } } else { - failures ++; + failures++; fwts_log_nl(fw); fwts_failed(fw, LOG_LEVEL_CRITICAL, "OPAL CPU Info", @@ -180,27 +180,27 @@ static int get_linux_xscom_devices(fwts_framework *fw) } if (get_xscom_property(fw, xscom_path, false, DT_PROPERTY_OPAL_SLOT_LOC)) { - failures ++; + failures++; } if (get_xscom_property(fw, xscom_path, false, DT_PROPERTY_OPAL_PART_NUM)) { - failures ++; + failures++; } if (get_xscom_property(fw, xscom_path, false, DT_PROPERTY_OPAL_SERIAL_NUM)) { - failures ++; + failures++; } if (get_xscom_property(fw, xscom_path, false, DT_PROPERTY_OPAL_VENDOR)) { - failures ++; + failures++; } if (get_xscom_property(fw, xscom_path, false, DT_PROPERTY_OPAL_BOARD_INFO)) { - failures ++; + failures++; } fwts_log_nl(fw); free(cpus); @@ -214,7 +214,7 @@ static int get_linux_xscom_devices(fwts_framework *fw) fwts_log_nl(fw); if (!found) { - failures ++; + failures++; fwts_failed(fw, LOG_LEVEL_CRITICAL, "OPAL CPU Info", "No CPU devices (xscom@X) were found in \"%s\"." diff --git a/src/opal/mem_info.c b/src/opal/mem_info.c index a5291e28..d5c12dc9 100644 --- a/src/opal/mem_info.c +++ b/src/opal/mem_info.c @@ -171,6 +171,8 @@ static int process_dimm( } if (strstr(my_buffer, my_string)) { + char my_prop_string[15]; + found = true; if (asprintf(&my_path, "%s/%s", @@ -190,7 +192,6 @@ static int process_dimm( continue; } - char my_prop_string[15]; strcpy(my_prop_string, "/memory-buffer"); if (check_status_property_okay(fw, my_path, my_prop_string, @@ -221,7 +222,6 @@ static int process_dimm( failures++; } } - free(my_path); free(my_buffer); free(namelist[i]); diff --git a/src/opal/mtd_info.c b/src/opal/mtd_info.c index 4a00fc46..79b0be6c 100644 --- a/src/opal/mtd_info.c +++ b/src/opal/mtd_info.c @@ -318,7 +318,6 @@ static int mtd_info_test1(fwts_framework *fw) } free(mtd_device_path); } - free(namelist[i]); } free(namelist); diff --git a/src/opal/pci_info.c b/src/opal/pci_info.c index 6ee5ea47..b641651e 100644 --- a/src/opal/pci_info.c +++ b/src/opal/pci_info.c @@ -315,7 +315,7 @@ static int get_linux_pci_devices(fwts_framework *fw) fwts_log_nl(fw); if (!found) { - failures ++; + failures++; fwts_failed(fw, LOG_LEVEL_CRITICAL, "OPAL PCI Info", "No root PCI devices (xxxx:00:00.0) were found"