From: Julia Lawall Date: Tue, 15 Dec 2009 02:00:09 +0000 (-0800) Subject: drivers/cpuidle: Move dereference after NULL test X-Git-Tag: v2.6.33-rc1~173 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faa7b7ddca14887ac037f585d2fac7ca6c57037e;p=pandora-kernel.git drivers/cpuidle: Move dereference after NULL test It does not seem possible that ldev can be NULL, so drop the unnecessary test. If ldev can somehow be NULL, then the initialization of last_idx should be moved below the test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld ... when != \(x = E\|&x\) * x == NULL // Signed-off-by: Julia Lawall Acked-by: Arjan van de Ven Cc: Ingo Molnar Cc: Venkatesh Pallipadi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed