Re: [Cocci] Replacing a struct member with a function call

2021-03-13 Thread Wolfram Sang
> @@ > type M; This? struct monitor* m; > @@ > - m->virtual.width; > + get_monitor_width(); signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] Supporting Coccinelle software

2020-02-14 Thread Wolfram Sang
On Fri, Feb 14, 2020 at 01:23:16PM +0100, Markus Elfring wrote: > > I cloned coccinelle's GIT repository, I suggested a patch, > > and the patch has been accepted. > > Will the chances increase for further contributions? Why do you want to know? signature.asc Description: PGP signature

Re: [Cocci] [PATCH v5 0/3] Add error message to platform_get_irq*()

2019-08-01 Thread Wolfram Sang
> these drivers pop up, I think we can have another function like > platform_get_irq_probe() or platform_get_irq_nowarn() that doesn't print > an error message. Then we can convert the drivers that are poking around > for interrupts to use this new function instead. It isn't the same as a >

Re: [Cocci] [PATCH v5 0/3] Add error message to platform_get_irq*()

2019-07-31 Thread Wolfram Sang
Hi Stephen, > There were some comments about adding an 'optional' platform_get_irq() > API in v4. This series doesn't include that, but I can add such an API > if it's required. I started to look into how it might work and got hung > up on what an optional IRQ means. I suppose it means that in DT

Re: [Cocci] [v5] coccinelle: semantic code search for missingput_device()

2019-02-16 Thread Wolfram Sang
Hi, On Sat, Feb 16, 2019 at 09:57:54AM +0100, Markus Elfring wrote: > > We don't need perfection. > > I guess that you noticed in the meantime that I dare to propose > more software development efforts in such a direction. Yes, this is noticable. It is your choice, however, other people may

Re: [Cocci] award for Coccinelle paper

2018-04-24 Thread Wolfram Sang
Julia, > > received the Eurosys "Test of Time" award. Many thanks to everyone on > > this list who has helped to make this possible. Congratulations from me, too! Very well deserved! > Warming people up, ready for the major award for Coccinelle What would that be? Best wishes,

Re: [Cocci] [PATCH] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-06-30 Thread Wolfram Sang
> I am working on a more general solution, extending to other functions. Sounds good, thanks! signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] [PATCH] Coccinelle: Script to replace NULL test with IS_ERR test for devm_ioremap_resource

2016-06-29 Thread Wolfram Sang
On Thu, Jun 30, 2016 at 12:03:47AM +0530, Amitoj Kaur Chawla wrote: > This script detects cases which have incorrect error handling for > devm_ioremap_resource function, employing a NULL test instead of an > IS_ERR() test. > > Signed-off-by: Amitoj Kaur Chawla Why don't we

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-13 Thread Wolfram Sang
> Is there another scripts/coccinelle/ file I can use to test against to demo > against glimpse/idutils/gitgrep best? I'd think this one may be a candidate: scripts/coccinelle/misc/irqf_oneshot.cocci Not too many, but quite some matches over the tree. signature.asc Description: PGP

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-11 Thread Wolfram Sang
> works pretty well, and there are quite a lot of files (7514) that contain > kfree. Ah, kfree. That explains, I missed that info. signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-10 Thread Wolfram Sang
> It's not as efficient as glimpse because the query language is simpler. Interesting, what is missing compared to glimpse? > So more filtering has to be done at the ocaml level. But it's probably > fine in most cases. For me, it has two advantages over glimpse: a) it is in the debian

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-10 Thread Wolfram Sang
> real16m11.692s > user127m50.388s > sys 0m2.168s That's better but not a magnitude, I wonder. signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-10 Thread Wolfram Sang
> AFAICT coccinelle does not have integration support for id-utils though. I used it just today ;) -- "--use-idutils ./ID" ID was generated with simple 'mkid -s'. signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-10 Thread Wolfram Sang
> > Well, slightly better. > > No, it should be much better. You would have to look at the standard I use id-utils regularly and it is indeed at least a magnitude better. The indexing often pays off already with the first coccinelle run for me. Highly recommended. signature.asc Description:

Re: [Cocci] [PATCH] Coccinelle: setup_timer: Add space in front of parentheses

2016-04-12 Thread Wolfram Sang
.com> > Signed-off-by: Vaishali Thakkar <vaishali.thak...@oracle.com> Tested-by: Wolfram Sang <w...@the-dreams.de> Can we have this in 4.6 as a bugfix? The script is totally broken this way. signature.asc Description: PGP signature ___ C

Re: [Cocci] [PATCH] scripts: coccinelle: remove check to move constants to right

2016-03-30 Thread Wolfram Sang
On Sat, Mar 19, 2016 at 06:43:08PM +0100, Julia Lawall wrote: > On Sat, 19 Mar 2016, Wolfram Sang wrote: > > > The header mentions this check depends on personal taste. I agree. > > Running coccicheck on patches before I apply them, this SmPL produced > > enough false p

Re: [Cocci] keeping cast affects match?

2016-02-17 Thread Wolfram Sang
> The isomorphism that allows ignoring a cast only works when the type > metavariable is used only once. You uare using it twice. The fact that > you wanted to add it indicates that you really want it to be there. Aha, I understand. Thank you for the explanation! > I think that everything

[Cocci] keeping cast affects match?

2016-02-17 Thread Wolfram Sang
Hi, using Coccinelle v1.04 from Debian: $ spatch -version spatch version 1.0.4 with Python support and with PCRE support The following semantic patch produces a match with current linux-next: @@ expression table, dev; type T; @@ - (T)of_match_device(table, dev)->data +

Re: [Cocci] version 1.0.0

2015-04-20 Thread Wolfram Sang
On Sun, Apr 19, 2015 at 05:37:21PM +0200, Julia Lawall wrote: Coccinelle version 1.0.0 is released. Congratulations, Julia! And thank you *very much* for all your hard work! All the best, Wolfram signature.asc Description: Digital signature ___

Re: [Cocci] how to debug missing match?

2014-12-21 Thread Wolfram Sang
On Sun, Dec 21, 2014 at 11:39:14AM +0100, Julia Lawall wrote: On Sun, 21 Dec 2014, Wolfram Sang wrote: does not result in anything although three drivers should match IMO with the same pattern as the pmu driver above. Both use platform_driver_register() and both have the .owner

Re: [Cocci] bugon.cocci: fix Options at the macro

2014-11-21 Thread Wolfram Sang
On Fri, Nov 07, 2014 at 06:51:05PM +0100, Wolfram Sang wrote: On Tue, Oct 28, 2014 at 03:18:24PM -0200, Mauro Carvalho Chehab wrote: The comma after --no-includes makes coccinelle to not run the script: /usr/bin/spatch -D report --very-quiet --no-show-diff --cocci-file ./scripts

Re: [Cocci] bugon.cocci: fix Options at the macro

2014-11-07 Thread Wolfram Sang
... At least with Fedora 20 coccinelle package: coccinelle-1.0.0-0.rc20.1.fc21.x86_64 Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com Yay, with this my patch handling scripts finally work again as they used to! Please let it go into 3.18. Tested-by: Wolfram Sang w

Re: [Cocci] sgen problems

2014-10-18 Thread Wolfram Sang
On Sat, Oct 18, 2014 at 08:02:00AM +0200, Julia Lawall wrote: @fix1_context depends on match1 !patch (context || org || report)@ identifier match1.__driver; position j0; @@ * static struct platform_driver __driver@j0 = { .driver = { .owner =

[Cocci] sgen problems

2014-10-17 Thread Wolfram Sang
= { .driver = { - .owner = THIS_MODULE, } }; // Generated config description = Remove .owner field if calls are used which set it automatically confidence = Moderate authors = Wolfram Sang. GPL v2. fix2 = org:No need to set .owner here

Re: [Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-12 Thread Wolfram Sang
So, what is your opinion on the original cleanup series removing unnecessary '.owner = THIS_MODULE' lines in drivers? Helpful? Noise? Helpful, please do it. I can take it all through my driver-core tree if you want, that might make things easier for others. Thanks, that might make sense

Re: [Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-11 Thread Wolfram Sang
You got me wondering, though, that it could not be correct to call platform_driver_register() from the platform core instead of module init. I will check tomorrow. Still, this would be a bug independent of my series. Although I'd need to respin it if platform_driver_probe() needed a

[Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-10 Thread Wolfram Sang
on linux-next of yesterday): git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git drop_platform_driver_owner This still results in 300 patches as this shortened pull request shows: === Wolfram Sang (299): ARM: common: drop owner assignment from platform_drivers ARM: mach-davinci

Re: [Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-10 Thread Wolfram Sang
The semantic patch looks fine. Wow, nothing to improve on the semantic patch? Now I am proud :) Thanks Julia for your support, as always! If you think that it would be useful to have this in the Linux kernel, so people don't add the owner initializer back in the future, you can try

Re: [Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-10 Thread Wolfram Sang
Hi Arnd, thanks for taking a look! On Fri, Oct 10, 2014 at 10:30:08AM +0200, Arnd Bergmann wrote: On Friday 10 October 2014 09:24:39 Wolfram Sang wrote: people found out that for platform_driver, we don't need to set the .owner field because this is done by the platform driver core. So far

Re: [Cocci] [RFC] drop owner assignment from platform_drivers

2014-10-10 Thread Wolfram Sang
On Fri, Oct 10, 2014 at 09:36:27AM +0100, Russell King - ARM Linux wrote: On Fri, Oct 10, 2014 at 09:24:39AM +0200, Wolfram Sang wrote: people found out that for platform_driver, we don't need to set the .owner field because this is done by the platform driver core. So far, so good. However

Re: [Cocci] Documentation generation for the release 1.0.0-rc22

2014-09-30 Thread Wolfram Sang
I have searched a bit in a few archives. Really? This is what my search found in approx. 3 seconds (assuming SUSE): http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/tex%28ptmr8t.tfm%29 signature.asc Description: Digital signature ___ Cocci

Re: [Cocci] Documentation generation for the release 1.0.0-rc22

2014-09-30 Thread Wolfram Sang
The tool RPM PBone Search was not on my radar screen for a while. It was the first hit for me when it googled suse and the font name :) Anyway, glad it works now... signature.asc Description: Digital signature ___ Cocci mailing list

Re: [Cocci] [PATCH 1/1] scripts/coccinelle: use BIT() macro if possible

2014-04-26 Thread Wolfram Sang
On Sun, Apr 27, 2014 at 02:29:46AM +0200, Javier Martinez Canillas wrote: Using the BIT() macro instead of manually shifting bits makes the code less error prone and also more readable. Does it? It is a taste thing, yet I don't think it makes the code that much more readable that it is worth

[Cocci] [bug] file not found with id-utils and include-headers

2013-10-13 Thread Wolfram Sang
Hi, using the latest Debian package from testing (rc18) and the following spatch on the Linux Kernel: @@ expression e; @@ - INIT_COMPLETION(e); + reinit_completion(e); Running with: spatch --sp-file /tmp/reinit_completion.cocci --use-idutils --include-headers ./ I get:

Re: [Cocci] [PATCH] scripts/coccinelle/api: remove devm_request_and_ioremap.cocci

2013-10-06 Thread Wolfram Sang
On Thu, Aug 15, 2013 at 12:30:25PM +0200, Wolfram Sang wrote: Use of this function is discouraged in favour of devm_ioremap_resource(). Don't advertise it. Signed-off-by: Wolfram Sang w...@the-dreams.de Ping. signature.asc Description: Digital signature

[Cocci] if statements including assignments

2013-08-26 Thread Wolfram Sang
Hi, I'd basically need something like: if (... when != var) to match. I couldn't find a way to express it. This is needed since there are constructs like: if (var = something()) which I don't want to match since they assign var a value which is fine in my case. Thanks,

Re: [Cocci] if statements including assignments

2013-08-26 Thread Wolfram Sang
I'd basically need something like: if (... when != var) This is not really clear enough for me to understand what you do want to do. I imagine that you want something like ( if (pattern_you_like) S1 else S2 | * if (pattern_you_dont_like) S1 else S2 ) Ah, so I was on a

[Cocci] Removing pointer declaration

2013-06-08 Thread Wolfram Sang
Hi, This spatch: @@ int *p; @@ - int *p; with this code: int main() { int *a; return 0; } results in: Fatal error: exception Failure(minus: parse error: = File test.cocci, line 5, column 7, charpos = 22 around = 'p', whole content = - int *p; ) using:

[Cocci] id-utils script?

2013-05-29 Thread Wolfram Sang
Hi, I wanted to try id-utils in comparison with grep, but I can't find the script 'idindex-cocci.sh' mentioned in the doc files. Not even in older releases. Does someone still have it? Is id-utils still supported? And while I am here, any outcome of the suggestion to use cscope? Thanks,

[Cocci] id-utils?

2013-05-25 Thread Wolfram Sang
Hi, I wanted to try the --id-utils option to see what the speedup was like. The docs mention a script called 'idindex-cocci.sh' to generate the index but I am unable to find it (no luck in older version of coccinelle, too). Does someone still have it? And in one older mail thread cscope was

[Cocci] isomorphism with unlikely

2013-05-20 Thread Wolfram Sang
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 (unlikely(r == NULL)) { ... } ) and running against the

Re: [Cocci] isomorphism with unlikely

2013-05-20 Thread Wolfram Sang
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 == NULL)' because the !r isomorphisms won't apply. I'd