From: Zbigniew Jędrzejewski-Szmek Date: Fri, 4 Sep 2020 14:06:07 +0000 (+0200) Subject: test-execute: simplify condition X-Git-Tag: v247-rc1~282^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f90d2d7bf1b6fc7469fbdeaca17c33a1f5b73cc8;p=thirdparty%2Fsystemd.git test-execute: simplify condition tests is always a static array, it cannot be NULL. --- diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 9ca06202165..b759786eafb 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -782,7 +782,6 @@ typedef struct test_entry { #define entry(x) {x, #x} static int run_tests(UnitFileScope scope, const test_entry tests[], char **patterns) { - const test_entry *test = NULL; _cleanup_(manager_freep) Manager *m = NULL; int r; @@ -795,7 +794,7 @@ static int run_tests(UnitFileScope scope, const test_entry tests[], char **patte assert_se(r >= 0); assert_se(manager_startup(m, NULL, NULL) >= 0); - for (test = tests; test && test->f; test++) + for (const test_entry *test = tests; test->f; test++) if (strv_fnmatch_or_empty(patterns, test->name, FNM_NOESCAPE)) test->f(m); else