Skip to contentSkip to conversation

docparse/docparse.c: Split the process of implied flags

PATCH New Xiao Yang 2 participants 3 messages Dec 9, 2020

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/2 docparse/docparse.c: Split the process of implied flags

Check implied flags in one loop and set implied flags in another loop so that the following false positive can be avoided:
----------------------------------------------------

# docparse/docparse testcases/kernel/syscalls/chdir/chdir01.c
testcases/kernel/syscalls/chdir/chdir01.c: useless tag: needs_device
...
----------------------------------------------------
---
 docparse/docparse.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
docparse/docparse.c +7 -7
index be6125353..22c5c6f2c 100644
@@ -401,15 +401,15 @@ int main(int argc, char *argv[])
 
 	/* Normalize the result */
 	for (i = 0; implies[i].flag; i++) {
-		if (!data_node_hash_get(res, implies[i].flag))
-			continue;
-
-		if (data_node_hash_get(res, implies[i].implies)) {
+		if (data_node_hash_get(res, implies[i].flag) &&
+		    data_node_hash_get(res, implies[i].implies))
 			fprintf(stderr, "%s: useless tag: %s\n", argv[1], implies[i].implies);
-			continue;
-		}
+	}
 
-		data_node_hash_add(res, implies[i].implies, data_node_string("1"));
+	for (i = 0; implies[i].flag; i++) {
+		if (data_node_hash_get(res, implies[i].flag) &&
+		    !data_node_hash_get(res, implies[i].implies))
+			data_node_hash_add(res, implies[i].implies, data_node_string("1"));
 	}
 
 	data_node_hash_add(res, "fname", data_node_string(argv[1]));
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 syscalls/fsconfig02.c: Remove unneeded .needs_tmpdir

.needs_device will enable .needs_tmpdir automatically so remove the unneeded flag.

---
 testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 -
 1 file changed, 1 deletion(-)
testcases/kernel/syscalls/fsconfig/fsconfig02.c +0 -1
index 20d77917f..9ff41a7d7 100644
@@ -94,7 +94,6 @@ static struct tst_test test = {
 	.test = run,
 	.setup = setup,
 	.cleanup = cleanup,
-	.needs_tmpdir = 1,
 	.needs_root = 1,
 	.needs_device = 1,
 };
Signature · 1 line
2.25.1