///
/// Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
///
// Confidence: High
// Copyright: (C) 2009, 2010 Nicolas Palix, DIKU.  GPLv2.
// Copyright: (C) 2009, 2010 Julia Lawall, DIKU.  GPLv2.
// Copyright: (C) 2009, 2010 Gilles Muller, INRIA/LiP6.  GPLv2.
// URL: http://coccinelle.lip6.fr/
// Options:
//
// Keywords: ERR_PTR, PTR_ERR, ERR_CAST
// Version min: 2.6.25
//

virtual context
virtual patch
virtual org
virtual report


@ depends on context && !patch && !org && !report@
expression x;
@@

* ERR_PTR(PTR_ERR(x))

@ depends on !context && patch && !org && !report @
expression x;
@@

- ERR_PTR(PTR_ERR(x))
+ ERR_CAST(x)

@r depends on !context && !patch && (org || report)@
expression x;
position p;
@@

 ERR_PTR@p(PTR_ERR(x))

@script:python depends on org@
p << r.p;
x << r.x;
@@

msg="WARNING ERR_CAST can be used with %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: ERR_CAST can be used with %s" % (x)
coccilib.report.print_report(p[0], msg)
aster</option>
<option value='nds-private-remove' selected='selected'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/?h=nds-private-remove'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/drivers/usb/misc/cytherm.c?h=nds-private-remove'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/drivers/usb/misc/cytherm.c?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/drivers/usb/misc/cytherm.c?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/misc/cytherm.c?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/drivers/usb/misc/cytherm.c'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='3ffc1af576550ec61d35668485954e49da29d168'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>drivers</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>usb</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/misc?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>misc</a>/<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/misc/cytherm.c?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168'>cytherm.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/drivers/usb/misc/cytherm.c?h=nds-private-remove&amp;id=3ffc1af576550ec61d35668485954e49da29d168&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>