All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Software analysis around data type annotations
@ 2020-06-16 16:51 Markus Elfring
  2020-06-17  3:29 ` Jaskaran Singh
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Elfring @ 2020-06-16 16:51 UTC (permalink / raw)
  To: Coccinelle

Hello,

The support for data processing with attributes was extended recently.
https://github.com/coccinelle/coccinelle/commits?q=committer-date%3A%3C2020-06-16

Under which circumstances will a source code analysis approach become supported
by a script (like the following) for the semantic patch language?


@display@
identifier action;
@@
*void __iomem * action(...)
 { ... }


elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci show_iomem_functions.cocci
…
minus: parse error:
  File "show_iomem_functions.cocci", line 4, column 14, charpos = 46
  around = '*',
  whole content = *void __iomem * action(...)


Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-16 16:51 [Cocci] Software analysis around data type annotations Markus Elfring
@ 2020-06-17  3:29 ` Jaskaran Singh
  2020-06-17  7:30   ` Markus Elfring
  0 siblings, 1 reply; 7+ messages in thread
From: Jaskaran Singh @ 2020-06-17  3:29 UTC (permalink / raw)
  To: Markus Elfring; +Cc: cocci


[-- Attachment #1.1: Type: text/plain, Size: 990 bytes --]

Hi Markus,

I'm away from my computer right now so can't test this, but try declaring
__iomem as an attribute:

@display@
identifier action;
attribute name __iomem;
@@


On Tue, 16 Jun 2020, 10:21 p.m. Markus Elfring <Markus.Elfring@web.de wrote:

> Hello,
>
> The support for data processing with attributes was extended recently.
>
> https://github.com/coccinelle/coccinelle/commits?q=committer-date%3A%3C2020-06-16
>
> Under which circumstances will a source code analysis approach become
> supported
> by a script (like the following) for the semantic patch language?
>
>
> @display@
> identifier action;
> @@
> *void __iomem * action(...)
>  { ... }
>
>
> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci
> show_iomem_functions.cocci
> …
> minus: parse error:
>   File "show_iomem_functions.cocci", line 4, column 14, charpos = 46
>   around = '*',
>   whole content = *void __iomem * action(...)
>
>
> Regards,
> Markus
>

[-- Attachment #1.2: Type: text/html, Size: 2005 bytes --]

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-17  3:29 ` Jaskaran Singh
@ 2020-06-17  7:30   ` Markus Elfring
  2020-06-17  7:44     ` Jaskaran Singh
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Elfring @ 2020-06-17  7:30 UTC (permalink / raw)
  To: Jaskaran Singh; +Cc: cocci

> I'm away from my computer right now so can't test this, but try declaring __iomem as an attribute:

@display@
attribute name __iomem;
identifier action;
@@
*void __iomem * action(...)
 { ... }


elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci show_iomem_functions2.cocci
…
minus: parse error:
  File "show_iomem_functions2.cocci", line 5, column 14, charpos = 70
  around = '*',
  whole content = *void __iomem * action(...)


Test version: 1.0.8-00131-g675b9670


How many software development resources will be needed
to get such SmPL script variants to work?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-17  7:30   ` Markus Elfring
@ 2020-06-17  7:44     ` Jaskaran Singh
  2020-06-17  8:12       ` Markus Elfring
  0 siblings, 1 reply; 7+ messages in thread
From: Jaskaran Singh @ 2020-06-17  7:44 UTC (permalink / raw)
  To: Markus Elfring; +Cc: cocci

On Wed, 2020-06-17 at 09:30 +0200, Markus Elfring wrote:
> > I'm away from my computer right now so can't test this, but try
> > declaring __iomem as an attribute:
> 
> @display@
> attribute name __iomem;
> identifier action;
> @@
> *void __iomem * action(...)
>  { ... }
> 
> 
> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci
> show_iomem_functions2.cocci
> …
> minus: parse error:
>   File "show_iomem_functions2.cocci", line 5, column 14, charpos = 70
>   around = '*',
>   whole content = *void __iomem * action(...)
> 
> 
> Test version: 1.0.8-00131-g675b9670
> 

Hm, okay this is due to a certain quirk in the SmPL parser, w/r/t
pointers. I don't think it was a big deal before, but now it might be
due to attributes...

Once I'm done with what I'm working on right now I'll get around to
this. Meanwhile, you could do the following:

@display@
attribute name __iomem;
identifier action;
@@
*void * __iomem action(...)
 {...}

It's not quite in line with the what-you-see-is-what-you-get principle,
but it'll work for your use case.

> 
> How many software development resources will be needed
> to get such SmPL script variants to work?
> 

Please stop asking such questions and I'll be happy to help you out.

Cheers,
Jaskaran.

> Regards,
> Markus

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-17  7:44     ` Jaskaran Singh
@ 2020-06-17  8:12       ` Markus Elfring
  2020-06-17  8:39         ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Elfring @ 2020-06-17  8:12 UTC (permalink / raw)
  To: Jaskaran Singh; +Cc: cocci

> *void * __iomem action(...)
>  {...}
>
> It's not quite in line with the what-you-see-is-what-you-get principle,
> but it'll work for your use case.

Usable output is produced after the adjusted position for the macro.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_iomem_functions3.cocci drivers/base/platform.c
…
-void __iomem *
-devm_platform_ioremap_resource_byname(struct platform_device *pdev,
-				      const char *name)
…


>> How many software development resources will be needed
>> to get such SmPL script variants to work?
>
> Please stop asking such questions

I am going to present similar questions occasionally.


> and I'll be happy to help you out.

Thanks for your positive feedback.

I imagine that I can offer more concrete development items
(besides the ones you might know already) if I would get
also additional resources.

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-17  8:12       ` Markus Elfring
@ 2020-06-17  8:39         ` Julia Lawall
  2020-06-17  8:52           ` Markus Elfring
  0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2020-06-17  8:39 UTC (permalink / raw)
  To: Markus Elfring; +Cc: cocci

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]



On Wed, 17 Jun 2020, Markus Elfring wrote:

> > *void * __iomem action(...)
> >  {...}
> >
> > It's not quite in line with the what-you-see-is-what-you-get principle,
> > but it'll work for your use case.
>
> Usable output is produced after the adjusted position for the macro.
>
> elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_iomem_functions3.cocci drivers/base/platform.c
> …
> -void __iomem *
> -devm_platform_ioremap_resource_byname(struct platform_device *pdev,
> -				      const char *name)
> …
>
>
> >> How many software development resources will be needed
> >> to get such SmPL script variants to work?
> >
> > Please stop asking such questions
>
> I am going to present similar questions occasionally.

Please stop.  The chance that people will help you will increase.  No one
is interested in quantifying software development resources.  Even your
favorite phrase "my software development attention" is really really
annoying.  Just drop "software development" from your vocabulary and it
will be a step in the right direction.

julia

>
>
> > and I'll be happy to help you out.
>
> Thanks for your positive feedback.
>
> I imagine that I can offer more concrete development items
> (besides the ones you might know already) if I would get
> also additional resources.
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Cocci] Software analysis around data type annotations
  2020-06-17  8:39         ` Julia Lawall
@ 2020-06-17  8:52           ` Markus Elfring
  0 siblings, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2020-06-17  8:52 UTC (permalink / raw)
  To: Julia Lawall, cocci

>> I am going to present similar questions occasionally.
>
> Please stop.

I hope that I can continue as usual for while according to a desire
to achieve further improvements.


> The chance that people will help you will increase.

This would be nice.


> No one is interested in quantifying software development resources.

Really?

I suggest to reconsider such a view.


> Even your favorite phrase "my software development attention"
> is really really annoying.  Just drop "software development"
> from your vocabulary and it will be a step in the right direction.

Will it become more interesting to clarify corresponding communication difficulties?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-06-17  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 16:51 [Cocci] Software analysis around data type annotations Markus Elfring
2020-06-17  3:29 ` Jaskaran Singh
2020-06-17  7:30   ` Markus Elfring
2020-06-17  7:44     ` Jaskaran Singh
2020-06-17  8:12       ` Markus Elfring
2020-06-17  8:39         ` Julia Lawall
2020-06-17  8:52           ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.