All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags
@ 2020-12-09 10:35 Xiao Yang
  2020-12-09 10:35 ` [LTP] [PATCH 2/2] syscalls/fsconfig02.c: Remove unneeded .needs_tmpdir Xiao Yang
  2020-12-09 15:10 ` [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags Cyril Hrubis
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Yang @ 2020-12-09 10:35 UTC (permalink / raw)
  To: ltp

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
...
----------------------------------------------------

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 docparse/docparse.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/docparse/docparse.c b/docparse/docparse.c
index be6125353..22c5c6f2c 100644
--- a/docparse/docparse.c
+++ b/docparse/docparse.c
@@ -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]));
-- 
2.25.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-09 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 10:35 [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags Xiao Yang
2020-12-09 10:35 ` [LTP] [PATCH 2/2] syscalls/fsconfig02.c: Remove unneeded .needs_tmpdir Xiao Yang
2020-12-09 15:10 ` [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.