lkml.org 
[lkml]   [2010]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] Add scripts/coccinelle/kzalloc-simple.cocci
Date
On Thursday 03 June 2010 11:51:43 Michal Marek wrote:
> On 10.5.2010 18:24, Nicolas Palix wrote:
> > +@script:python depends on org@
> > +p << r.p;
> > +x << r.x;
> > +@@
> > +
> > +msg="%s" % (x)
> > +msg_safe=msg.replace("[","@(").replace("]",")")
> > +coccilib.org.print_todo(p[0], msg_safe)
> > +
> > +@script:python depends on report@
> > +p << r.p;
> > +x << r.x;
> > +@@
> > +
> > +msg="WARNING: kzalloc should be used for %s, instead of kmalloc/memset" % (x)
> > +coccilib.report.print_report(p[0], msg_safe)
>
> msg_safe is not defined in this scriptlet, I'm only getting
>
> Traceback (most recent call last):
> File "<string>", line 5, in <module>
> NameError: name 'msg_safe' is not defined

Oops. Thank you for reporting this.

I fixed it for my upcoming submission.

In the meantime, you can replace "msg_safe" by "msg" in the rule
dedicated to the "report" mode.

That is

coccilib.report.print_report(p[0], msg_safe)

by

coccilib.report.print_report(p[0], msg

The good point is that you only reach this point if Coccinelle has found
something to change in the code. So there is some patches to do... ;)


>
> Michal
>

--
Nicolas Palix
Tel: (+33) 1 44 27 87 25
Tel: (+33) 6 81 07 91 72
Web: http://www.diku.dk/~npalix/


\
 
 \ /
  Last update: 2010-06-03 12:13    [W:0.096 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site