All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] prinkt specifiers
@ 2017-10-11  0:07 Tobin C. Harding
  2017-10-11  5:27 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Tobin C. Harding @ 2017-10-11  0:07 UTC (permalink / raw)
  To: cocci

Hi,

Is it possible to craft a coccinelle script to find and replace calls (in the kernel) that are
printing pointers using %x.

Perhaps we could easily catch the calls that are casting the pointer within argument list, for example

	pr_info("x: %llx\n", (unsigned long long int)ptr);

I'm happy to try and work out how to do it, just chasing a 'yes that is exactly the type of thing
cocci is good at' or a 'no, you are dreaming, perhaps <this tool> can do that'

thanks,
Tobin.

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

* [Cocci] prinkt specifiers
  2017-10-11  0:07 [Cocci] prinkt specifiers Tobin C. Harding
@ 2017-10-11  5:27 ` Julia Lawall
  2017-10-12  2:11   ` Tobin C. Harding
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2017-10-11  5:27 UTC (permalink / raw)
  To: cocci



On Wed, 11 Oct 2017, Tobin C. Harding wrote:

> Hi,
>
> Is it possible to craft a coccinelle script to find and replace calls (in the kernel) that are
> printing pointers using %x.
>
> Perhaps we could easily catch the calls that are casting the pointer within argument list, for example
>
> 	pr_info("x: %llx\n", (unsigned long long int)ptr);
>
> I'm happy to try and work out how to do it, just chasing a 'yes that is exactly the type of thing
> cocci is good at' or a 'no, you are dreaming, perhaps <this tool> can do that'

It's possible.  Look at coccinelle/demos/format.cocci

This may not be the most well tested part of Coccinelle, so if it is not
doing what you expect, please feel free to complain.

julia

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

* [Cocci] prinkt specifiers
  2017-10-11  5:27 ` Julia Lawall
@ 2017-10-12  2:11   ` Tobin C. Harding
  0 siblings, 0 replies; 3+ messages in thread
From: Tobin C. Harding @ 2017-10-12  2:11 UTC (permalink / raw)
  To: cocci

On Wed, Oct 11, 2017 at 07:27:43AM +0200, Julia Lawall wrote:
> 
> 
> On Wed, 11 Oct 2017, Tobin C. Harding wrote:
> 
> > Hi,
> >
> > Is it possible to craft a coccinelle script to find and replace calls (in the kernel) that are
> > printing pointers using %x.
> >
> > Perhaps we could easily catch the calls that are casting the pointer within argument list, for example
> >
> > 	pr_info("x: %llx\n", (unsigned long long int)ptr);
> >
> > I'm happy to try and work out how to do it, just chasing a 'yes that is exactly the type of thing
> > cocci is good at' or a 'no, you are dreaming, perhaps <this tool> can do that'
> 
> It's possible.  Look at coccinelle/demos/format.cocci
> 
> This may not be the most well tested part of Coccinelle, so if it is not
> doing what you expect, please feel free to complain.
> 
> julia

Thanks Julia

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

end of thread, other threads:[~2017-10-12  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-11  0:07 [Cocci] prinkt specifiers Tobin C. Harding
2017-10-11  5:27 ` Julia Lawall
2017-10-12  2:11   ` Tobin C. Harding

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.