Re: [Cocci] Proposal for a new checkpatch check; matching _set_drvdata() & _get_drvdata()

2020-11-20 Thread Lars-Peter Clausen
On 11/20/20 12:54 PM, Alexandru Ardelean wrote: On Fri, Nov 20, 2020 at 12:47 PM Julia Lawall wrote: On Thu, 19 Nov 2020, Joe Perches wrote: On Thu, 2020-11-19 at 17:16 +0200, Andy Shevchenko wrote: On Thu, Nov 19, 2020 at 4:09 PM Alexandru Ardelean wrote: Hey, So, I stumbled on a new

Re: [Cocci] =~ runtime improvements?

2018-09-30 Thread Lars-Peter Clausen
On 09/27/2018 08:51 PM, Kees Cook wrote: > Hi, > > This .cocci takes a VERY long time to run against the kernel, and I'd > love to know what I could do to improve it. I assume it's related to > the use of the "=~" operand: > Maybe I'm missing something, but do you need all of those variations?

Re: [Cocci] [PATCH] Coccinelle: misc: Improve the script for more accurate results

2016-10-14 Thread Lars-Peter Clausen
On 10/13/2016 07:01 PM, Vaishali Thakkar wrote: > > > On Thursday 13 October 2016 09:45 PM, Julia Lawall wrote: >> >> >> On Thu, 13 Oct 2016, Vaishali Thakkar wrote: >> >>> Currently because of the left associativity of the operators, >>> pattern IRQF_ONESHOT | flags does not match with the

Re: [Cocci] how to find missing initializer

2015-12-03 Thread Lars-Peter Clausen
On 12/03/2015 02:04 PM, Peter Hurley wrote: > Hi all, > > I'm struggling with the grammar necessary to find struct definitions > missing an initializer. > > The background is that many tty interfaces include a method/operations > table (named fields of function ptrs). For example, given a

Re: [Cocci] How can i rename a specific structure field?

2014-10-02 Thread Lars-Peter Clausen
On 10/02/2014 10:12 PM, jmiguel hernandez wrote: if i have this typedef struct type1 { char8 a; char8 b; char8 c; } typedef struct _interface { type1 field1; }interface; and want to change to typedef struct type1 { char8 d; char8 b; char8 c; } typedef struct _protocol {

Re: [Cocci] cocci: char* indexing style for linux

2014-08-18 Thread Lars-Peter Clausen
On 08/17/2014 07:42 PM, Julia Lawall wrote: On Sun, 17 Aug 2014, Joe Perches wrote: On Sun, 2014-08-17 at 18:09 +0200, SF Markus Elfring wrote: I would prefer to be able to convert *(skb-data + frame_size / 2 + 10) not to (skb-data + frame_size / 2)[10] but to

Re: [Cocci] cocci: char* indexing style for linux

2014-08-18 Thread Lars-Peter Clausen
On 08/18/2014 11:49 AM, Julia Lawall wrote: Actually, isn't the whoe structure field the wrong way to go about it here? Don't we just want a pointer-typed expression, of whatever form it has? That will unfortunately require lots of type information, but I don't see how to do it otherewise,

Re: [Cocci] cocci: char* indexing style for linux

2014-08-18 Thread Lars-Peter Clausen
On 08/18/2014 11:49 AM, Julia Lawall wrote: Actually, isn't the whoe structure field the wrong way to go about it here? Don't we just want a pointer-typed expression, of whatever form it has? That will unfortunately require lots of type information, but I don't see how to do it otherewise,

Re: [Cocci] [PATCH v2 1/1] scripts/coccinelle: use BIT macro if used

2014-04-29 Thread Lars-Peter Clausen
On 04/27/2014 12:50 PM, Javier Martinez Canillas wrote: Using the BIT() macro instead of manually shifting bits makes the code less error prone. If is more readable is a matter of taste so only replace if the file is already using this macro. Signed-off-by: Javier Martinez Canillas

Re: [Cocci] isomorphism with unlikely

2013-05-20 Thread Lars-Peter Clausen
On 05/20/2013 07:34 PM, Wolfram Sang wrote: Hi, using 1.0-rc16 from debian, I use the following semantic patch: @@ expression r, p, n; @@ r = platform_get_resource(p, IORESOURCE_MEM, n); ... ( - if (!r) { ... } | - if (unlikely(!r)) { ... } | - if

Re: [Cocci] isomorphism with unlikely

2013-05-20 Thread Lars-Peter Clausen
On 05/20/2013 08:24 PM, Wolfram Sang wrote: There is already an isomorphism for unlikely. But it is in one direction only, so 'unlikely(E)' in your cocci script will also match 'E', but 'E' wont match 'unlikely(E)'. Okay, but I would then still need 'unlikely(!r)' and 'unlikely(r ==