Re: [Cocci] [PATCH 22/23] tests: Add test case for removing parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Add a test case for removing Parameter attributes. The test case checks > correct removal of the attribute when it is: > > - before the parameter type. > - after the parameter type and before the parameter identifier. > - after the parameter

Re: [Cocci] [PATCH 15/23] parsing_cocci: visitor_ast: Visit Parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Parameter attributes are added to the SmPL AST. Visit these attributes in > the AST visitor. > > Signed-off-by: Jaskaran Singh > --- > parsing_cocci/visitor_ast.ml | 22 +- > 1 file changed, 17 insertions(+), 5 deletions(-) > >

Re: [Cocci] [PATCH 12/23] parsing_cocci: unparse_ast0: Reflect Parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Parameter attributes are added to the SmPL AST. Reflect these changes in > unparse_ast0.ml. > > Signed-off-by: Jaskaran Singh > --- > parsing_cocci/unparse_ast0.ml | 15 --- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff

Re: [Cocci] [PATCH 10/23] parsing_cocci: iso_pattern: Reflect Parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Parameter attributes are added to the SmPL AST. Reflect these changes in > iso_pattern.ml. > > Signed-off-by: Jaskaran Singh > --- > parsing_cocci/iso_pattern.ml | 22 ++ > 1 file changed, 18 insertions(+), 4 deletions(-) > >

Re: [Cocci] [PATCH 06/23] parsing_cocci: compute_lines: Reflect Parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Parameter attributes are added to the SmPL AST. Reflect these changes in > compute_lines.ml. > > Signed-off-by: Jaskaran Singh > --- > parsing_cocci/compute_lines.ml | 15 +-- > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff

Re: [Cocci] [PATCH 05/23] parsing_cocci: check_meta: Reflect Parameter attributes

2020-04-27 Thread Julia Lawall
On Mon, 27 Apr 2020, Jaskaran Singh wrote: > Parameter attributes are added to the SmPL AST. Reflect these changes in > check_meta.ml. Maybe add a comment that for the moment there are no metavariables for attributes. julia > > Signed-off-by: Jaskaran Singh > --- >

[Cocci] [PATCH v2 08/23] parsing_cocci: function_prototypes: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in function_prototypes.ml. Signed-off-by: Jaskaran Singh --- Changes in v2: - Removed unnecessary function name change (collect_ident_strings). parsing_cocci/function_prototypes.ml | 8 1 file changed, 4

[Cocci] [PATCH 22/23] tests: Add test case for removing parameter attributes

2020-04-27 Thread Jaskaran Singh
Add a test case for removing Parameter attributes. The test case checks correct removal of the attribute when it is: - before the parameter type. - after the parameter type and before the parameter identifier. - after the parameter identifier. Signed-off-by: Jaskaran Singh ---

[Cocci] [PATCH 16/23] parsing_cocci: ast0toast: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in ast0toast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0toast.ml | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml index

[Cocci] [PATCH 23/23] tests: Add test case to detect parameter attributes

2020-04-27 Thread Jaskaran Singh
Add a test case to detect parameter attributes in C. The test case changes the type of the parameter if it has the attribute. The cases covered are for when the attribute is: - before the parameter type. - after the parameter type and before the parameter identifier. - after the parameter

[Cocci] [PATCH 14/23] parsing_cocci: ast_cocci: Add Parameter attributes

2020-04-27 Thread Jaskaran Singh
Add parameter attributes to the SmPL AST. This is a list of attributes in the VoidParam and Param types of the SmPL AST. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast_cocci.ml | 4 ++-- parsing_cocci/ast_cocci.mli | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[Cocci] [PATCH 15/23] parsing_cocci: visitor_ast: Visit Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Visit these attributes in the AST visitor. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast.ml | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/parsing_cocci/visitor_ast.ml

[Cocci] [PATCH 10/23] parsing_cocci: iso_pattern: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in iso_pattern.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/iso_pattern.ml | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/parsing_cocci/iso_pattern.ml

[Cocci] [PATCH 12/23] parsing_cocci: unparse_ast0: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in unparse_ast0.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unparse_ast0.ml | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/parsing_cocci/unparse_ast0.ml

[Cocci] [PATCH 13/23] parsing_c: unparse_cocci: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Print these attributes correctly in unparse_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_c/unparse_cocci.ml | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/parsing_c/unparse_cocci.ml

[Cocci] [PATCH 11/23] parsing_cocci: type_infer: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in type_infer.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/type_infer.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsing_cocci/type_infer.ml b/parsing_cocci/type_infer.ml index

[Cocci] [PATCH 17/23] parsing_cocci: disjdistr: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in disjdistr.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/disjdistr.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parsing_cocci/disjdistr.ml b/parsing_cocci/disjdistr.ml index

[Cocci] [PATCH 21/23] ocaml: coccilib: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in coccilib.mli. Signed-off-by: Jaskaran Singh --- ocaml/coccilib.mli | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli index 0e807c9a..59c58aea 100644 ---

[Cocci] [PATCH 20/23] engine: cocci_vs_c: Match Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the C and SmPL AST. Match the attributes correctly in cocci_vs_c.ml. Signed-off-by: Jaskaran Singh --- engine/cocci_vs_c.ml | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml index

[Cocci] [PATCH 18/23] parsing_cocci: pretty_print_cocci: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Print these attributes correctly in pretty_print_cocci.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/pretty_print_cocci.ml | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git

[Cocci] [PATCH 19/23] parsing_cocci: unify_ast: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in unify_ast.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/unify_ast.ml | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml index

[Cocci] [PATCH 00/23] cocci: Add parameter attributes to SmPL

2020-04-27 Thread Jaskaran Singh
This patch series aims to add parameter attributes to SmPL, and is a continuation of the series "cocci: Improve C parsing of attributes"[1]. In [1], parameter attributes were added to the C AST of Coccinelle, but not to SmPL. Two test cases are included: - detect_param_attr: Test case to detect

[Cocci] [PATCH 05/23] parsing_cocci: check_meta: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in check_meta.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/check_meta.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsing_cocci/check_meta.ml b/parsing_cocci/check_meta.ml index

[Cocci] [PATCH 02/23] parsing_cocci: parser: Parse Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Parse these attributes correctly in the SmPL parser. The added production only supports attributes after the type or the type and identifier. Signed-off-by: Jaskaran Singh --- parsing_cocci/parser_cocci_menhir.mly | 7 --- 1 file changed, 4

[Cocci] [PATCH 08/23] parsing_cocci: function_prototypes: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in function_prototypes.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/function_prototypes.ml | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/parsing_cocci/function_prototypes.ml

[Cocci] [PATCH 06/23] parsing_cocci: compute_lines: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in compute_lines.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/compute_lines.ml | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/parsing_cocci/compute_lines.ml

[Cocci] [PATCH 09/23] parsing_cocci: index: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in index.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/index.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml index f7ae48b4..1baeb2bb 100644 ---

[Cocci] [PATCH 04/23] parsing_cocci: arity: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in arity.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/arity.ml | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml index

[Cocci] [PATCH 03/23] parsing_cocci: visitor_ast0: Visit Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to AST0 of SmPL. Visit these attributes in the AST0 visitor. Signed-off-by: Jaskaran Singh --- parsing_cocci/visitor_ast0.ml | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/parsing_cocci/visitor_ast0.ml

[Cocci] [PATCH 07/23] parsing_cocci: context_neg: Reflect Parameter attributes

2020-04-27 Thread Jaskaran Singh
Parameter attributes are added to the SmPL AST. Reflect these changes in context_neg.ml. Signed-off-by: Jaskaran Singh --- parsing_cocci/context_neg.ml | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci/context_neg.ml

[Cocci] [PATCH 01/23] parsing_cocci: ast0_cocci: Add parameter attributes

2020-04-27 Thread Jaskaran Singh
Add parameter attributes to AST0 of SmPL. This is a list of attributes in the VoidParam and Param types of AST0. Signed-off-by: Jaskaran Singh --- parsing_cocci/ast0_cocci.ml | 4 ++-- parsing_cocci/ast0_cocci.mli | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [Cocci] [PATCH] dpaa_eth: Fix comparing pointer to 0

2020-04-27 Thread Markus Elfring
> Fixes coccicheck warning: > ./drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2110:30-31: > WARNING comparing pointer to 0 Such information is actually provided by a known script for the semantic patch language.