fujitsu-laptop: Correct redundant test
authorJulia Lawall <julia@diku.dk>
Fri, 31 Jul 2009 08:42:00 +0000 (18:12 +0930)
committerLen Brown <len.brown@intel.com>
Fri, 28 Aug 2009 19:17:08 +0000 (15:17 -0400)
commit14485c57270e8f3de2a25abaf93bae5712c97e9e
tree4d9a05bc9b88d5722088c1f816af64ba7a47c0c2
parent1e384cb0f9a940f2a431d1708f963987e61d71e3
fujitsu-laptop: Correct redundant test

device and acpi_driver_data(device) were tested just a few lines above.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
@@

if (x == NULL || ...) { ... when forall
   return ...; }
.. when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
*x == NULL
|
*x != NULL
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/fujitsu-laptop.c