]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-execute: simplify condition
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 4 Sep 2020 14:06:07 +0000 (16:06 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 4 Sep 2020 16:11:22 +0000 (18:11 +0200)
tests is always a static array, it cannot be NULL.

src/test/test-execute.c

index 9ca062021657219847b67fc5aa4685fb2c3cb539..b759786eafbe126e606f51485d7c1101f05339a1 100644 (file)
@@ -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