perf tools: Move dereference after NULL test
authorJulia Lawall <julia@diku.dk>
Sat, 17 Oct 2009 06:43:17 +0000 (08:43 +0200)
committerIngo Molnar <mingo@elte.hu>
Sat, 17 Oct 2009 07:29:10 +0000 (09:29 +0200)
In each case, if the NULL test on thread is needed, then the
dereference should be after the NULL test.

A simplified version of the semantic match that detects this
problem is as follows (http://coccinelle.lip6.fr/):

// <smpl>
@match exists@
expression x, E;
identifier fld;
@@

* x->fld
  ... when != \(x = E\|&x\)
* x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
LKML-Reference: <Pine.LNX.4.64.0910170842500.9213@ask.diku.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

No differences found