From patchwork Wed Aug 15 13:11:04 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: 957871 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 41r8xQ0yHSz9sCS; Wed, 15 Aug 2018 23:11:37 +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 1fpvaI-0003m9-OT; Wed, 15 Aug 2018 13:11:34 +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 1fpvaF-0003k3-Ia for fwts-devel@lists.ubuntu.com; Wed, 15 Aug 2018 13:11:31 +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 1fpvaF-000866-8e; Wed, 15 Aug 2018 13:11:31 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 02/27] fwts_framework: no need to pass tests_to_skip as it is locally scoped Date: Wed, 15 Aug 2018 14:11:04 +0100 Message-Id: <20180815131129.24146-3-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180815131129.24146-1-colin.king@canonical.com> References: <20180815131129.24146-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 List tests_to_skip is locally scoped in the source, so there is no need to pass it as an argument into a couple of functions. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_framework.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c index 60b9bd66..47299ef4 100644 --- a/src/lib/src/fwts_framework.c +++ b/src/lib/src/fwts_framework.c @@ -984,11 +984,11 @@ static void fwts_framework_heading_info( * fwts_framework_skip_test() * try to find a test in list of tests to be skipped, return NULL of cannot be found */ -static fwts_framework_test *fwts_framework_skip_test(fwts_list *tests_to_skip, fwts_framework_test *test) +static fwts_framework_test *fwts_framework_skip_test(fwts_framework_test *test) { fwts_list_link *item; - fwts_list_foreach(item, tests_to_skip) + fwts_list_foreach(item, &tests_to_skip) if (test == fwts_list_data(fwts_framework_test *, item)) return test; @@ -999,7 +999,7 @@ static fwts_framework_test *fwts_framework_skip_test(fwts_list *tests_to_skip, f * fwts_framework_skip_test_parse() * parse optarg of comma separated list of tests to skip */ -static int fwts_framework_skip_test_parse(const char *arg, fwts_list *tests_to_skip) +static int fwts_framework_skip_test_parse(const char *arg) { char *str; char *token; @@ -1011,7 +1011,7 @@ static int fwts_framework_skip_test_parse(const char *arg, fwts_list *tests_to_s fprintf(stderr, "No such test '%s'\n", token); return FWTS_ERROR; } else - fwts_list_append(tests_to_skip, test); + fwts_list_append(&tests_to_skip, test); } return FWTS_OK; @@ -1249,7 +1249,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar | FWTS_FLAG_SHOW_PROGRESS_DIALOG; break; case 24: /* --skip-test */ - if (fwts_framework_skip_test_parse(optarg, &tests_to_skip) != FWTS_OK) + if (fwts_framework_skip_test_parse(optarg) != FWTS_OK) return FWTS_COMPLETE; break; case 25: /* --quiet */ @@ -1404,7 +1404,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar fw->flags |= FWTS_FLAG_SHOW_TESTS; break; case 'S': /* --skip-test */ - if (fwts_framework_skip_test_parse(optarg, &tests_to_skip) != FWTS_OK) + if (fwts_framework_skip_test_parse(optarg) != FWTS_OK) return FWTS_COMPLETE; break; case 't': /* --table-path */ @@ -1569,7 +1569,7 @@ int fwts_framework_args(const int argc, char **argv) goto tidy; } - if (fwts_framework_skip_test(&tests_to_skip, test) == NULL) + if (fwts_framework_skip_test(test) == NULL) fwts_list_append(&tests_to_run, test); } @@ -1582,7 +1582,7 @@ int fwts_framework_args(const int argc, char **argv) fwts_list_foreach(item, &fwts_framework_test_list) { fwts_framework_test *test = fwts_list_data(fwts_framework_test*, item); if (fw->flags & test->flags & FWTS_FLAG_RUN_ALL) - if (fwts_framework_skip_test(&tests_to_skip, test) == NULL) + if (fwts_framework_skip_test(test) == NULL) fwts_list_append(&tests_to_run, test); }