Re: [PATCH] coccinelle: Add str_off_on() and str_no_yes() rules

2024-10-27 Thread Julia Lawall
On Sun, 27 Oct 2024, Andy Shevchenko wrote: > On Sun, Oct 27, 2024 at 2:59 PM Thorsten Blum wrote: > > > > In addition to str_on_off() and str_yes_no(), add rules to search for > > str_off_on() and str_no_yes() replacements. > > I don't know cocci well enough, but this does simply not scale. We

Re: [PATCH -next v3 00/10] coccinelle: Add some rules for string_chioces helpers.

2024-09-28 Thread Julia Lawall
On Wed, 11 Sep 2024, Hongbo Li wrote: > We found that many of the detection rules for helpers in > string_choices.h are missing. This series of patches is > intended to complete these rules. We have verified in the > latest kernel tree that these rules can detect many places > where the string

Re: [PATCH -next v3 01/10] coccinelle: Add rules to find str_true_false() replacements

2024-09-23 Thread Julia Lawall
Thanks for testing it. I will see if there is some other way to improve the performance. Sent from my iPhone > On 23 Sep 2024, at 09:01, Hongbo Li wrote: > >  > >> On 2024/9/19 14:25, Julia Lawall wrote: >>> On Wed, 11 Sep 2024, Hongbo Li wrote: >>> After

Re: [PATCH -next v3 01/10] coccinelle: Add rules to find str_true_false() replacements

2024-09-18 Thread Julia Lawall
On Wed, 11 Sep 2024, Hongbo Li wrote: > After str_true_false() has been introduced in the tree, > we can add rules for finding places where str_true_false() > can be used. A simple test can find over 10 locations. > > Signed-off-by: Hongbo Li > --- > scripts/coccinelle/api/string_choices.cocc

Re: [PATCH -next v2 0/9] coccinelle: Add some rules for string_chioces helpers.

2024-09-09 Thread Julia Lawall
On Wed, 4 Sep 2024, Hongbo Li wrote: > We found that many of the detection rules for helpers in > string_choices.h are missing. This series of patches is > intended to complete these rules. We have verified in the > latest kernel tree that these rules can detect many places > where the string c

Re: [PATCH -next v2 1/9] coccinelle: Add rules to find str_true_false() replacements

2024-09-09 Thread Julia Lawall
On Wed, 4 Sep 2024, Hongbo Li wrote: > After str_true_false() has been introduced in the tree, > we can add rules for finding places where str_true_false() > can be used. A simple test can find over 10 locations. > > Signed-off-by: Hongbo Li > --- > scripts/coccinelle/api/string_choices.cocci

Re: [PATCH] pstore/ram: Replace of_node_put with __free() for automatic cleanup

2024-04-24 Thread Julia Lawall
om parent_node struct. > > > > Suggested-by: Julia Lawall > > Signed-off-by: Abhinav Jain > > --- > > fs/pstore/ram.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c > > index b1a455f42e

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
On Tue, 19 Dec 2023, Luis Chamberlain wrote: > On Tue, Dec 19, 2023 at 10:21:25PM +0100, Julia Lawall wrote: > > > As I noted, I think this is a generically neat endeavor and so I think > > > it would be nice to shorthand *any* member of the struct. ctl->any. >

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
I came up with the following: @@ type t; const t *x; identifier y,z; expression a; assignment operator aop; @@ ( (<+...(<+...x->y...+>)[...]...+>) aop a | (<+...(<+...x->y...+>)->z...+>) aop a | * (<+...x->y...+>) aop a ) @fn disable optional_qualifier@ identifier f,x; type t; parameter list

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
> As I noted, I think this is a generically neat endeavor and so I think > it would be nice to shorthand *any* member of the struct. ctl->any. > Julia, is that possible? What do you mean by *any* member? If any is an identifier typed metavariable then that would get any immediate member. But may

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
On Tue, 19 Dec 2023, Thomas Weißschuh wrote: > Hi Luis and Julia, > > (Julia, there is a question and context for you inline, marked with your name) > > On 2023-12-18 13:21:49-0800, Luis Chamberlain wrote: > > So we can split this up concentually in two: > > > > * constificaiton of the table ha

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-15 Thread Julia Lawall
On Fri, 15 Dec 2023, Thomas Weißschuh wrote: > On 2023-12-12 23:51:30-0800, Luis Chamberlain wrote: > > On Tue, Dec 12, 2023 at 10:09:30AM +0100, Joel Granados wrote: > > > My idea was to do something similar to your originl RFC, where you have > > > an temporary proc_handler something like proc

Re: [PATCH v2 2/2] net: openvswitch: Annotate struct mask_array with __counted_by

2023-10-14 Thread Julia Lawall
On Sat, 14 Oct 2023, Kees Cook wrote: > On Sat, Oct 14, 2023 at 08:34:53AM +0200, Christophe JAILLET wrote: > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > attribute. Flexible array members annotated with __counted_by can have > > their accesses bounds-checked

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-10-01 Thread Julia Lawall
On Sun, 1 Oct 2023, Kees Cook wrote: > On Sun, Oct 01, 2023 at 02:22:17PM -0700, Kees Cook wrote: > > On Sun, Oct 01, 2023 at 02:05:46PM -0700, Kees Cook wrote: > > > On Sun, Oct 01, 2023 at 09:14:02PM +0200, Julia Lawall wrote: > > > > Kees, > > &

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-10-01 Thread Julia Lawall
Kees, You can try the following. julia #spatch --all-includes @r@ identifier i,j; type T; @@ struct i { ... T j[]; } @s@ identifier r.i; constant ini; identifier j; initializer list [n] is2; position p; identifier x; @@ struct i@p x = { ..., .j = ini, ..., { is2 } } ; @scrip

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-10-01 Thread Julia Lawall
On Sat, 30 Sep 2023, Kees Cook wrote: > On Sat, Sep 30, 2023 at 11:14:47AM +0200, Christophe JAILLET wrote: > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > attribute. Flexible array members annotated with __counted_by can have > > their accesses bounds-checked

Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-10-01 Thread Julia Lawall
On Sat, 30 Sep 2023, Kees Cook wrote: > On Sat, Sep 30, 2023 at 11:14:47AM +0200, Christophe JAILLET wrote: > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > attribute. Flexible array members annotated with __counted_by can have > > their accesses bounds-checked