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

* [LTP] [PATCH 2/2] syscalls/fsconfig02.c: Remove unneeded .needs_tmpdir
  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 ` Xiao Yang
  2020-12-09 15:10 ` [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Xiao Yang @ 2020-12-09 10:35 UTC (permalink / raw)
  To: ltp

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

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fsconfig/fsconfig02.c b/testcases/kernel/syscalls/fsconfig/fsconfig02.c
index 20d77917f..9ff41a7d7 100644
--- a/testcases/kernel/syscalls/fsconfig/fsconfig02.c
+++ b/testcases/kernel/syscalls/fsconfig/fsconfig02.c
@@ -94,7 +94,6 @@ static struct tst_test test = {
 	.test = run,
 	.setup = setup,
 	.cleanup = cleanup,
-	.needs_tmpdir = 1,
 	.needs_root = 1,
 	.needs_device = 1,
 };
-- 
2.25.1




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

* [LTP] [PATCH 1/2] docparse/docparse.c: Split the process of implied flags
  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 ` Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2020-12-09 15:10 UTC (permalink / raw)
  To: ltp

Hi!
Good catch, applied, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[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.