Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-31 Thread Julia Lawall
> > > > Do the checks for the opportunities for kvmalloc really belong in this > > rule? That issue is not mentioned in the commit log or the description of > > the semantic patch. > > I added this at the last moment. It was easy enough to add it based on > existing > patterns. I will add descrip

Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-31 Thread Julia Lawall
On Fri, 31 Jul 2020, Markus Elfring wrote: > >>> +msg = "WARNING: kmalloc is used to allocate this memory at line %s" % > >>> (k[0].line) > >>> +coccilib.org.print_todo(p[0], msg) > >> > >> * I find the diagnostic text insufficient. > > > > I also find the message not very informative. > > Is i

Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-31 Thread Denis Efremov
> With the current patch mode, I got some changes in a recent linux-next. > Have you sent patches for these issues? For mellanox, I've sent these patches: https://lkml.org/lkml/2020/6/5/901 https://lkml.org/lkml/2020/6/1/713 They were accepted. I see two new places in mellanox driver in linux-

Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-30 Thread Julia Lawall
On Thu, 30 Jul 2020, Denis Efremov wrote: > Check that alloc and free types of functions match each other. Do the checks for the opportunities for kvmalloc really belong in this rule? That issue is not mentioned in the commit log or the description of the semantic patch. With the current pat

Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-30 Thread Julia Lawall
Actually, the message looks fine. Sorry for the noise about that. However there is a problem in the kfree case: > +@kfree depends on !patch@ > +expression E; > +position v != choice.vok; > +position p; > +@@ > + > +* E = > \(vmalloc@v\|vzalloc@v\|vmalloc_user@v\|vmalloc_node@v\|vzalloc_node@v\|

Re: [PATCH v4] coccinelle: api: add kvfree script

2020-07-30 Thread Julia Lawall
> > +msg = "WARNING: kmalloc is used to allocate this memory at line %s" % > > (k[0].line) > > +coccilib.org.print_todo(p[0], msg) > > * I find the diagnostic text insufficient. I also find the message not very informative. All of the other comments are not useful, and some are simply incorrect.

[PATCH v4] coccinelle: api: add kvfree script

2020-07-30 Thread Denis Efremov
Check that alloc and free types of functions match each other. Signed-off-by: Denis Efremov --- Changes in v2: - Lines are limited to 80 characters where possible - Confidence changed from High to Medium because of fs/btrfs/send.c:1119 false-positive - __vmalloc_area_node() explicitly excl