docparse/docparse.c: Split the process of implied flags
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 ... ----------------------------------------------------
Signed-off-by Xiao Yang <[email protected]>
--- docparse/docparse.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
docparse/docparse.c +7 -7
@@ -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
PATCH 2/2 syscalls/fsconfig02.c: Remove unneeded .needs_tmpdir
.needs_device will enable .needs_tmpdir automatically so remove the unneeded flag.
Signed-off-by Xiao Yang <[email protected]>
--- testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 - 1 file changed, 1 deletion(-)
testcases/kernel/syscalls/fsconfig/fsconfig02.c +0 -1
@@ -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
PATCH 1/2 docparse/docparse.c: Split the process of implied flags
In reply to Xiao YangHi!
Good catch, applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]