On Mon, 2 Aug 2021, Joe Perches wrote:
> On Mon, 2021-08-02 at 19:35 +0200, Julia Lawall wrote:
> >
> > On Mon, 2 Aug 2021, Joe Perches wrote:
> >
> > > Is it possible to determine the length of a matched char array and use
> > > the length in a test?
On Mon, 2 Aug 2021, Joe Perches wrote:
> Is it possible to determine the length of a matched char array and use
> the length in a test?
>
> For instance, add something like a test to show only the instances
> where a src buffer overruns a dest buffer.
>
> void foo(void)
> {
> char
On Fri, 30 Jul 2021, Daniel Thompson wrote:
> Currently use_after_iter.cocci generates false positives for code of the
> following form:
> ~~~
> list_for_each_entry(d, >irq_list, node) {
> if (irq == d->irq)
> break;
> }
>
> if
Here is another attempt:
@initialize:ocaml@
@@
let check p =
let p = List.hd p in
p.line_end = p.current_element_line_end
@ detect_func @
identifier CLI_FN, AVM, AIN, ACMD;
fresh identifier LAIN = "line_" ## AIN;
expression ERR, exp;
statement S1;
typedef clib_error_t, vlib_main_t,
> yourtch@ayourtch-lnx:~/cocci$ diff -c patch-old.cocci patch-new.cocci
> *** patch-old.cocci 2021-07-22 22:41:19.516957878 +0200
> --- patch-new.cocci 2021-07-22 22:41:52.625184341 +0200
> ***
> *** 3,8
> --- 3,9
> fresh identifier LAIN = "line_" ## AIN;
>
>
> I missed the fact that the "return ERR" were actually not replaced on
> this example at all,
This is because there are no occurrences of return ERR; in your code.
Probably you expected ERR to be a metavariable, but it's not. Actually,
fully capitalizing your metavariables is not a good idea.
On Thu, 22 Jul 2021, Andrew Yourtchenko wrote:
> Hi all,
>
> I work on the VPP project (http://fd.io/ - open source software
> dataplane), and tried to use coccinelle to make a relatively
> non-trivial change
> as in the mail https://lists.fd.io/g/vpp-dev/message/17532 - it seemed
> to be a
On Tue, 13 Jul 2021, Joe Perches wrote:
> On Tue, 2021-07-13 at 23:33 +0200, Julia Lawall wrote:
> > > > On Fri, 9 Jul 2021, Joe Perches wrote:
> > > > > Here is a cocci script to convert various types of bitmap allocations
> > > > > that use B
On Sat, 10 Jul 2021, Joe Perches wrote:
> On Sat, 2021-07-10 at 21:50 +0200, Julia Lawall wrote:
> > On Fri, 9 Jul 2021, Joe Perches wrote:
> >
> > > Here is a cocci script to convert various types of bitmap allocations
> > > that use BITS_TO_LONGS to the mo
On Sat, 10 Jul 2021, Joe Perches wrote:
> On Sat, 2021-07-10 at 21:50 +0200, Julia Lawall wrote:
> > On Fri, 9 Jul 2021, Joe Perches wrote:
> >
> > > Here is a cocci script to convert various types of bitmap allocations
> > > that use BITS_TO_LONGS to the mo
On Fri, 9 Jul 2021, Joe Perches wrote:
> Here is a cocci script to convert various types of bitmap allocations
> that use BITS_TO_LONGS to the more typical bitmap_alloc functions.
>
> Perhaps something like it could be added to scripts/coccinelle.
> The diff produced by the script is also
On Fri, 2 Jul 2021, Sumera Priyadarsini wrote:
> On Wed, May 26, 2021 at 10:13 PM Markus Elfring wrote:
> >
> > > This patchset adds a feature to enable Coccinelle
> > > to only check all those files in a directory which were
> > > modified. It parses all the files obtained from the
> > >
On Wed, 16 Jun 2021, Christophe JAILLET wrote:
> 'pci_alloc_consistent()' is about to be removed from the kernel.
> It is now more useful to check for dma_alloc_coherent/dma_free_coherent.
>
> So change the script accordingly and rename it.
There also seem to be a lot of false positives,
On Wed, 16 Jun 2021, Christophe JAILLET wrote:
> 'pci_alloc_consistent()' is about to be removed from the kernel.
> It is now more useful to check for dma_alloc_coherent/dma_free_coherent.
dma_alloc_coherent has four arguments, and in the script there are only
three. Is the number of
On Wed, 23 Jun 2021, Fuad Tabba wrote:
> Hi,
>
> I have a semantic patch that inserts a new variable definition into a
> function. I would like it if that variable definition is the only one
> in the function, then it should add a new line to separate the
> definition from following statements
On Sat, 5 Jun 2021, Jason A. Donenfeld wrote:
> That makes sense. Thank you so much for your help. Committed here (and
> credited you as co-author):
> https://git.zx2c4.com/wireguard-freebsd/commit/?id=b13579613ffcbe56c28df79972a74025007a85b7
Cool. Thanks :)
julia
On Sat, 5 Jun 2021, Jason A. Donenfeld wrote:
> Thanks! That seems to be it indeed. Interestingly, including the
> actual path to the real headers with -I didn't fix the issue.
Most of the time, Coccinelle doesn't use macro definitions. The -I could
have been useful for figuring out some
Try making a file def.h:
#define CK_LIST_HEAD(x,y) int
#define CK_LIST_ENTRY(x) int
and then add to your command line
--macro-file def.h
There seem to be a few other such macros that are needed.
Unrelatedly, you can also add --very-quiet to the command line, to have a
less verbose output.
On Sat, 5 Jun 2021, Jason A. Donenfeld wrote:
> Hi Julia,
>
> Holy mackerel, that's amazing. Thank you so much! Very fancy embedding
> the ocaml in there, and just using a hash table. Neat idea.
>
> I'm running it (well, a modified version, pasted below) on a codebase
> and finding that it
On Sat, 5 Jun 2021, Jason A. Donenfeld wrote:
> Hi Julia,
>
> Holy mackerel, that's amazing. Thank you so much! Very fancy embedding
> the ocaml in there, and just using a hash table. Neat idea.
>
> I'm running it (well, a modified version, pasted below) on a codebase
> and finding that it
On Sat, 5 Jun 2021, Jason A. Donenfeld wrote:
> Hi,
>
> I'm trying to write a spatch rule that has some inversion logic for a
> given struct member, but I'm struggling to express this in SmPL. I'm
> also a bit of a coccinelle novice, however. Specifically, I'm trying
> to express:
>
> For all
On Fri, 4 Jun 2021, Jonas Schrottenbaum wrote:
> Hello,
> i'm currently trying to check out coccinelle and already could apply a simple
> semantic patch to a small C program with the spatch command.
>
> Please excuse me, but i'm quite a beginner in this field.
>
> I read on this page, about
On Thu, 27 May 2021, Fuad Tabba wrote:
> On Thu, May 27, 2021 at 12:44 PM Julia Lawall wrote:
> >
> > > @@
> > > expression a, b;
> > > identifier vcpu;
> > > fresh identifier vcpu_ctxt = vcpu ## "_ctxt";
>
> @@
> expression a, b;
> identifier vcpu;
> fresh identifier vcpu_ctxt = vcpu ## "_ctxt";
> iterator name kvm_for_each_vcpu;
> identifier fc;
> @@
> kvm_for_each_vcpu(a, vcpu, b)
> {
> /* hop over any declarations */
> + vcpu_ctxt = >arch.ctxt;
> <+...
> fc(..., vcpu, ...)
> ...+>
> }
>
> So
On Thu, 27 May 2021, Julia Lawall wrote:
>
>
> On Thu, 27 May 2021, Fuad Tabba wrote:
>
> > Hi,
> >
> > I'm trying to write a semantic patch that would add a new line to a
> > function, but would like that line to come after all local variables
> >
On Thu, 27 May 2021, Fuad Tabba wrote:
> Hi,
>
> I'm trying to write a semantic patch that would add a new line to a
> function, but would like that line to come after all local variables
> (if any) have been declared. For example (distilled from what I am
> actually trying to accomplish):
>
>
On Tue, 18 May 2021, Mauro Carvalho Chehab wrote:
> When LANG is not set to English, the logic which checks the
> number of CPUs fail, as the messages can be localized, and
> the logic at:
>
> THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd
> "[:digit:]")
>
> will not get
use it aolso deals with the cases where {}s need to be removed.
pm_runtime_resume_and_get was introduced in
commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
deal with usage counter")
Signed-off-by: Julia Lawall
Acked-by: Rafael J. Wysocki
---
v6: don't touch cod
On Wed, 5 May 2021, Mauro Carvalho Chehab wrote:
> Hi Julia,
>
> Em Thu, 29 Apr 2021 19:43:43 +0200
> Julia Lawall escreveu:
>
> > pm_runtime_get_sync keeps a reference count on failure, which can lead
> > to leaks. pm_runtime_resume_and_get drops the reference co
usage counter")
Signed-off-by: Julia Lawall
Acked-by: Rafael J. Wysocki
---
v5: print a message with the new function name, as suggested by Markus Elfring
v4: s/pm_runtime_resume_and_get/pm_runtime_put_noidle/ as noted by John Hovold
v3: add the people who signed off on commit dd8088d5a896, expa
usage counter")
Signed-off-by: Julia Lawall
Acked-by: Rafael J. Wysocki
---
v4: s/pm_runtime_resume_and_get/pm_runtime_put_noidle/ as noted by John Hovold
v3: add the people who signed off on commit dd8088d5a896, expand the log message
v2: better keyword
scripts/cocc
usage counter")
Signed-off-by: Julia Lawall
---
v3: add the people who signed off on commit dd8088d5a896, expand the log message
v2: better keyword
scripts/coccinelle/api/pm_runtime_resume_and_get.cocci | 153 +
1 file changed, 153 insertions(+)
diff --git a/scripts/cocc
On Tue, 27 Apr 2021, Johan Hovold wrote:
> On Mon, Apr 26, 2021 at 08:54:04PM +0200, Julia Lawall wrote:
> > pm_runtime_get_sync keeps a reference count on failure, which can lead
> > to leaks. pm_runtime_resume_and_get drops the reference count in the
> > failure
to be needed in the failure case.
pm_runtime_resume_and_get was introduced in
commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
deal with usage counter")
Signed-off-by: Julia Lawall
---
v2: better keyword
scripts/coccinelle/api/pm_runtime_resume_and_get.co
to be needed in the failure case.
pm_runtime_resume_and_get was introduced in
commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
deal with usage counter")
Signed-off-by: Julia Lawall
---
scripts/coccinelle/api/pm_runtime_resume_and_get.cocci | 153 +++
On Fri, 23 Apr 2021, Krzysztof Kozlowski wrote:
> The IRQF_ONESHOT should be present for threaded IRQ using default
> primary handler. However intetrupt of many child devices, e.g. children
> of MFD, is nested thus the IRQF_ONESHOT is not needed. The coccinelle
> message about error misleads
On Wed, 21 Apr 2021, Akos Pasztory wrote:
> Hi,
>
> I'm trying do the following kind of transformations:
>
> int x, y;
> char *p;
> bool b, c;
>
> -b = x || !y;
> +b = (x != 0) || (y == 0);
>
> -c = !p;
> +c = (p == NULL);
>
> -if (x & 3)
> +if ((x & 3) != 0)
> f();
> // etc
>
> That is:
On Wed, 21 Apr 2021, Fuad Tabba wrote:
> Hi,
>
> I just started using Coccinelle yesterday, and I can already see
> it saving me a lot of time and agony. Thank you.
>
> I ran into a problem, and I think that this patch might fix it,
> hopefully without causing other problems. I did some sanity
Context mode is not supported, so the *s are just confusing to people
who use the rule outside of make coccicheck. So, drop the *s.
Fixes: 6dd9379e8f32 ("coccinelle: also catch kzfree() issues")
Reported-by: Fabio M. De Francesco
Signed-off-by: Julia Lawall
---
scripts/cocci
On Mon, 5 Apr 2021, Michael Walle wrote:
> Hi Mansour,
>
> Am 2021-04-04 19:48, schrieb Mansour Moufid:
> > On Thu, Apr 1, 2021 at 4:13 AM Michael Walle wrote:
> > >
> > > Hi,
> > >
> > > so first I need to say I've never used coccinelle before,
> > > so please bear with me ;)
> > >
> > > To
On Mon, 5 Apr 2021, Markus Elfring wrote:
> >> I would like to avoid the repetition of parsing efforts as much as
> >> possible.
> >> Under which circumstances can replacement lists be taken better into
> >> account?
> >
> > Why does my suggestion involve a repetition of parsing effort?
>
>
On Mon, 5 Apr 2021, Markus Elfring wrote:
> >> @display@
> >> identifier i =~ "^(?:[A-Z]+_){3,3}[A-Z]+", x;
> >> constant c =~ "\"";
> >> @@
> >> *#define i x c
> >>
> >>
> >> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci
> >> show_define_usage6.cocci
> >> …
> >> minus:
On Mon, 5 Apr 2021, Markus Elfring wrote:
> > Thanks for the simpler examples.
>
> Would you like to support another search pattern by the means of
> the semantic patch language?
>
>
> @display@
> identifier i =~ "^(?:[A-Z]+_){3,3}[A-Z]+", x;
> constant c =~ "\"";
> @@
> *#define i x c
>
>
>
On Sun, 4 Apr 2021, Mansour Moufid wrote:
> On Thu, Apr 1, 2021 at 4:13 AM Michael Walle wrote:
> >
> > Hi,
> >
> > so first I need to say I've never used coccinelle before,
> > so please bear with me ;)
> >
> > To make of_get_mac_address() work with DSA ports (and a nvmem
> > provider) I'd
On Sun, 28 Mar 2021, Denis Efremov wrote:
> Ping?
Applied. Thanks.
>
> On 3/5/21 1:09 PM, Denis Efremov wrote:
> > Check for opencoded swap() implementation.
> >
> > Signed-off-by: Denis Efremov
> > ---
> > Changes in v2:
> > - additional patch rule to drop excessive {}
> > - fix
On Sun, 4 Apr 2021, Markus Elfring wrote:
> >> I hoped that the specified constraint for the metavariable “e” would mean
> >> that expressions which contain a double quotation character should be
> >> excluded
> >> for my source code analysis approach.
> >> Would you like to check the observed
On Sun, 4 Apr 2021, Markus Elfring wrote:
> > The following looks like what one might want to do to find #defines that
> > are near each other.
>
> I have tried another SmPL script variant out.
>
>
> @initialize:python@
> @@
> import sys
>
> records = {}
>
> class integrity_error:
>pass
>
>
On Sun, 28 Mar 2021, Markus Elfring wrote:
> >> Would you like to help any more with attempts to achieve support for
> >> a transformation pattern like “#define ⇒ enum” according to the semantic
> >> patch language?
> >> https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/981
> >>
On Sun, 28 Mar 2021, Markus Elfring wrote:
> > And what is the problem here?
>
> Would you like to discuss further software development ideas
> according to another SmPL script example like the following?
The following looks like what one might want to do to find #defines that
are near each
On Sun, 28 Mar 2021, Markus Elfring wrote:
> >> Another SmPL script example:
> >>
> >> @display2@
> >> identifier i;
> >> expression e;
> >> @@
> >> *#define i e
> >>
> >>
> >> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch
> >> show_define_usage2.cocci
On Sun, 28 Mar 2021, Markus Elfring wrote:
> >> @display@
> >> @@
> >> *#define
> >
> > Obviously this doesn't work. Just like
> >
> > @@
> > @@
> > *if
> >
> > doesnt' work.
>
> Can it become possible to find such key words in the source code
> (by such SmPL search approaches)?
No. As has
On Sun, 28 Mar 2021, Markus Elfring wrote:
> > If you find that something does not work satisfactorily, propose a
> > semantic patch and show what doesn't work.
>
> @display@
> @@
> *#define
Obviously this doesn't work. Just like
@@
@@
*if
doesnt' work.
> > I'm not going to try to solve a
On Sun, 28 Mar 2021, Markus Elfring wrote:
> > Probably the simplest is to put the names of the header files in a file,
> > eg find . -name "*h" > header_list, and then give the arguement
> > --file-groups header_list to Coccinelle.
>
> How are the chances to add support for another program
On Sun, 28 Mar 2021, Markus Elfring wrote:
> >> https://github.com/coccinelle/coccinelle/issues/139
> >
> > I looked at the link, but there is no concrete example of something that
> > does not work, so I have no idea what the problem is.
>
> You expressed another bit of better understanding of
On Sun, 28 Mar 2021, Markus Elfring wrote:
> Hello,
>
> Will the software development interests ever evolve in ways so that #define
> directives
> can be replaced with the help of the semantic patch language for special
> source code
> analysis and transformation approaches?
>
On Sun, 28 Mar 2021, Markus Elfring wrote:
> Hello,
>
> The Coccinelle software can search for header files in addition to source
> files
> if the option “--include-headers” was specified.
>
On Mon, 8 Mar 2021, Denis Efremov wrote:
> Skip patches generation for structs/unions with a single field.
> Changing a zero-length array to a flexible array member in a struct
> with no named members breaks the compilation. However, reporting
> such cases is still valuable, e.g. commit
On Fri, 19 Mar 2021, Evan Benn wrote:
> Hello,
>
> I am attempting to create a coccinelle script that will detect possibly buggy
> usage of the bitwise operators where integer promotion may result in bugs,
> usually due to sign extension.
>
> I know this script needs a lot more work, but I am
On Thu, 18 Mar 2021, Thomas Adam wrote:
> Hello all,
>
> I've another Coccinelle question I'm hoping you can help me with. The
> codebase I'm working on is old, and has some interesting styles which
> by themselves probably don't cause any problems, but newer C compilers
> are now starting to
On Wed, 17 Mar 2021, Denis Efremov wrote:
> Hi,
>
> I'm trying to write the check to detect the absence of commit
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=51b2ee7d006a736a9126e8111d1f24e4fd0afaa6
> in kernel. The pattern can be:
>
> @err exists@
>
On Mon, 15 Mar 2021, Mansour Moufid wrote:
> On Sun, Mar 14, 2021, 20:43 Thomas Adam wrote:
> Hello,
>
> I can see I was as clear as mud with my explanation -- apologies
> for
> that, so let me try again.
>
> In my original example:
>
> struct monitor {
>
ts on the stack size). That will conclude by
telling you the tokens it is most unhappy with. You can often get away
with defining a few dummy macros.
If none of that works, please send a small function that illustrates the
problem and the complete semantic patch.
julia
>
> Kindly
On Sun, 14 Mar 2021, Wolfram Sang wrote:
>
> > @@
> > type M;
>
> This?
>
> struct monitor* m;
>
> > @@
> > - m->virtual.width;
> > + get_monitor_width();
I guess that m should be somewhere in teh call to get_monitor_width too?
julia
___
Cocci
> +@pmaxif depends on patch@
> +identifier func;
> +expression x, y;
> +expression max_val;
> +binary operator cmp = {>=, >};
> +@@
> +
> +func(...)
> +{
> + <...
> +-if ((x) cmp (y)) {
> +-max_val = (x);
> +-} else {
> +-max_val = (y);
> +-}
> ++max_val
On Sun, 7 Mar 2021, Joe Perches wrote:
> On Sun, 2021-03-07 at 20:14 +0100, Julia Lawall wrote:
> >
> > On Wed, 3 Mar 2021, Joe Perches wrote:
> >
> > > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> > > > On 02/03/2021 18.42, Joe P
On Wed, 3 Mar 2021, Joe Perches wrote:
> On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote:
> > On 02/03/2021 18.42, Joe Perches wrote:
> > > Here is a possible opportunity to reduce data usage in the kernel.
> > >
> > > $ git grep -P -n
On Fri, 19 Feb 2021, Denis Efremov wrote:
> Check for opencoded min(), max() implementations.
>
> Signed-off-by: Denis Efremov
> ---
>
> Changes in v2:
> - <... ...> instead of ... when any
> - org mode reports fixed
> - patch rule to drop excessive ()
>
>
On Wed, 3 Mar 2021, Mansour Moufid wrote:
> On Tue, Mar 2, 2021 at 4:22 PM Joe Perches wrote:
> >
> > Here is a possible opportunity to reduce data usage in the kernel.
> >
> > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]'
> > drivers/ | \
> > grep -v __initdata
On Fri, 19 Feb 2021, Denis Efremov wrote:
> Check for opencoded swap() implementation.
>
> Signed-off-by: Denis Efremov
> ---
> Changes in v2:
> - additional patch rule to drop excessive {}
> - fix indentation in patch mode by anchoring ;
>
> scripts/coccinelle/misc/swap.cocci | 101
On Tue, 2 Mar 2021, Bernd Petrovitsch wrote:
> Hi all!
>
> On 02/03/2021 18:42, Joe Perches wrote:
> [...]
> > - For instance: (head -10 of the git grep for file statics)
> >
> > drivers/accessibility/speakup/keyhelp.c:18:static u_short masks[] = { 32,
> > 16, 8, 4, 2, 1 };
> >
On Tue, 2 Mar 2021, Joe Perches wrote:
> Here is a possible opportunity to reduce data usage in the kernel.
Does it actually reduce data usage?
julia
>
> $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]'
> drivers/ | \
> grep -v __initdata | \
> wc -l
> 3250
>
>
This problem is fixed now in the github version.
Thanks again Richard and Markus for the report.
julia
On Tue, 2 Mar 2021, Richard W.M. Jones wrote:
> ocamlfind ocamlopt -c -package result -package seq -bin-annot -no-alias-deps
> -I . -alert -deprecated stdcompat__arg_s.mli -o
On Tue, 2 Mar 2021, Richard W.M. Jones wrote:
> ocamlfind ocamlopt -c -package result -package seq -bin-annot -no-alias-deps
> -I . -alert -deprecated stdcompat__arg_s.mli -o stdcompat__arg_s.cmi
> File "stdcompat__arg_s.mli", lines 3-17, characters 0-38:
> 3 | type spec = Arg.spec =
> 4 |
On Sat, 27 Feb 2021, Denis Efremov wrote:
>
>
> On 2/27/21 12:14 PM, Julia Lawall wrote:
> >
> >
> > On Sat, 27 Feb 2021, Denis Efremov wrote:
> >
> >> Hi,
> >>
> >> Great news!
> >>
> >> Could you please crea
rsion 1.0.9. We moved on to 1.1 due to the #spatch
feature.
julia
> Thanks,
> Denis
>
> On 2/27/21 11:11 AM, Julia Lawall wrote:
> > A new version 1.1.0 has been released. The most interesting change is the
> > ability to put spatch command line options in a .cocci file, for exa
A new version 1.1.0 has been released. The most interesting change is the
ability to put spatch command line options in a .cocci file, for example:
#spatch --very-quiet -j 8 --recursive-includes --include-headers-for-types
Other specific improvements are an improved handling of attributes and a
On Thu, 18 Feb 2021, Markus Elfring wrote:
> > A disjunction basically says "at this node in the cfg, can I match the
> > first patter, or can I match the second pattern, etc." Unfortunately in
> > this case the two branches start matching at different nodes, so the short
> > circuit aspect
On Thu, 18 Feb 2021, Denis Efremov wrote:
>
>
> On 2/18/21 1:17 PM, Julia Lawall wrote:
> >
> >
> > On Thu, 18 Feb 2021, Denis Efremov wrote:
> >
> >>
> >>
> >> On 2/18/21 12:31 AM, Julia Lawall wrote:
> >>>> +@depend
On Mon, 15 Feb 2021, Denis Efremov wrote:
>
>
> On 2/15/21 2:47 PM, Julia Lawall wrote:
> >
> >
> > On Mon, 15 Feb 2021, Denis Efremov wrote:
> >
> >> Hi,
> >>
> >> I wrote a simple rule (swap.cocci):
> >>
> >> v
On Mon, 15 Feb 2021, Denis Efremov wrote:
> Hi,
>
> I wrote a simple rule (swap.cocci):
>
> virtual patch
>
> @depends on patch@
> identifier tmp;
> expression a, b;
> type T;
> @@
>
> (
> - T tmp;
> |
> - T tmp = 0;
> |
> - T *tmp = NULL;
> )
> ... when != tmp
> - tmp = a;
> - a = b;
> - b =
On Mon, 15 Feb 2021, Denis Efremov wrote:
> Hi,
>
> I wrote a simple rule (swap.cocci):
>
> virtual patch
>
> @depends on patch@
> identifier tmp;
> expression a, b;
> type T;
> @@
>
> (
> - T tmp;
> |
> - T tmp = 0;
> |
> - T *tmp = NULL;
> )
> ... when != tmp
> - tmp = a;
> - a = b;
> - b =
On Sat, 13 Feb 2021, Taylor Blau wrote:
> Hi Julia,
>
> On Fri, Feb 12, 2021 at 03:06:16PM +0100, Julia Lawall wrote:
> > > Is there a planned release of coccinelle that will appear in the focal
> > > suite?
> >
> > Can you use the PPA?
> >
>
On Fri, 12 Feb 2021, Denis Efremov wrote:
>
>
> On 2/12/21 5:04 PM, Julia Lawall wrote:
> >
> >
> > On Thu, 11 Feb 2021, Denis Efremov wrote:
> >
> >> Hi, one of my patterns started to fail tests on latest coccinelle.
> >> I've bisected th
On Tue, 9 Feb 2021, Taylor Blau wrote:
> Hi,
>
> The Git project recently noticed that our static analysis builds were
> failing after upgrading to Ubuntu 20.04 due to being unable to find the
> coccinelle package in the focal suite.
>
>
On Thu, 11 Feb 2021, Denis Efremov wrote:
> Hi, one of my patterns started to fail tests on latest coccinelle.
> I've bisected the commit that introduces "error". It's:
> commit db60e916633d2cb3ae31140364783fdf85ed10f4
> "make information about SmPL iterator and declarer names available to the
On Thu, 11 Feb 2021, Denis Efremov wrote:
> Hi, one of my patterns started to fail tests on latest coccinelle.
> I've bisected the commit that introduces "error". It's:
> commit db60e916633d2cb3ae31140364783fdf85ed10f4
> "make information about SmPL iterator and declarer names available to the
On Wed, 27 Jan 2021, James K. Lowden wrote:
> I don't understand how, if it's possible, to qualify a function in a
> rule. I want the class of all functions having a parameter of a
> particular type.
>
> The code I'm working with has hundreds of unnecessary casts. Many
> functions take a
Hello,
I will give a tutorial talk about Coccinelle on February 2, at 7:30AM PST.
It is possible to register at the following link:
https://events.linuxfoundation.org/mentorship-session-coccinelle/
julia
___
Cocci mailing list
Cocci@systeme.lip6.fr
On Wed, 13 Jan 2021, Maxime Ripard wrote:
> Hi!
>
> I've been trying to get a patch to rename any variable called "state" in
> a given set of callbacks.
>
> This is the patch that I've come up with:
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const
On Tue, 12 Jan 2021, Denis Efremov wrote:
>
>
> On 1/12/21 7:13 PM, Julia Lawall wrote:
> >
> >
> > On Tue, 12 Jan 2021, Denis Efremov wrote:
> >
> >> Hi,
> >>
> >> Let's suppose I have this pattern:
> >>
On Tue, 12 Jan 2021, Denis Efremov wrote:
> Hi,
>
> Let's suppose I have this pattern:
> @fix exists@
> position p;
> @@
>
> binder_release_work(...)
> {
> ...
> switch (...) {
> * case BINDER_WORK_NODE: ... break;@p
> }
> ...
Add when any to the outer ...s
On Mon, 11 Jan 2021, Denis Efremov wrote:
>
>
> On 1/11/21 11:40 PM, Julia Lawall wrote:
> >
> >
> > On Mon, 11 Jan 2021, Denis Efremov wrote:
> >
> >>
> >>
> >> On 1/11/21 11:23 PM, Julia Lawall wrote:
> >>&g
On Mon, 11 Jan 2021, Denis Efremov wrote:
>
>
> On 1/11/21 11:23 PM, Julia Lawall wrote:
> >
> >
> > On Mon, 11 Jan 2021, Denis Efremov wrote:
> >
> >> Hi,
> >>
> >> Let's suppose I want to match otx_cpt_aead_cbc_aes_sha_setke
On Mon, 11 Jan 2021, Denis Efremov wrote:
> Hi,
>
> Let's suppose I want to match otx_cpt_aead_cbc_aes_sha_setkey() function from
> drivers/crypto/marvell/octeontx/otx_cptvf_algs.c file (linux kernel).
>
> My pattern:
> @exists@
> identifier rta, param, key, keylen;
> position p;
> @@
>
>
> But this fails:
>
> @@
> type T;
> identifier var;
> attribute name autofree;
> @@
>
> T var autofree;
> ...
> ++ free(var);
> return ...;
>
> with
>
> minus: parse error:
>File "autofree.cocci", line 7, column 17, charpos = 73
>around = ';',
>whole content =T
On Tue, 5 Jan 2021, Richard W.M. Jones wrote:
> Firstly a gentle reminder that there's a patch waiting to be applied:
> https://systeme.lip6.fr/pipermail/cocci/2020-November/thread.html#8398
>
> Different from that patch, but still related to Python 3.10, we've got
> another bug report here:
>
On Thu, 31 Dec 2020, Joe Perches wrote:
> On Thu, 2020-12-31 at 21:27 +0100, Julia Lawall wrote:
> > On Thu, 31 Dec 2020, Joe Perches wrote:
> > > On Thu, 2020-12-31 at 11:04 -0800, Joe Perches wrote:
> > > > strlcpy is deprecated. see: Docume
On Thu, 31 Dec 2020, Joe Perches wrote:
> On Thu, 2020-12-31 at 21:27 +0100, Julia Lawall wrote:
> > On Thu, 31 Dec 2020, Joe Perches wrote:
> > > On Thu, 2020-12-31 at 11:04 -0800, Joe Perches wrote:
> > > > strlcpy is deprecated. see: Docume
On Thu, 31 Dec 2020, Joe Perches wrote:
> On Thu, 2020-12-31 at 11:04 -0800, Joe Perches wrote:
> > strlcpy is deprecated. see: Documentation/process/deprecated.rst
> >
> > Change the calls that do not use the strlcpy return value to the
> > preferred strscpy.
> >
> > Done with cocci script:
On Wed, 25 Nov 2020, Sumera Priyadarsini wrote:
> The command "make coccicheck C=1 CHECK=scripts/coccicheck" results in the
> error:
> ./scripts/coccicheck: line 65: -1: shift count out of range
>
> This happens because every time the C variable is specified,
> the shell arguments need
1 - 100 of 2189 matches
Mail list logo