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>
This commit is contained in:
Julia Lawall 2009-07-31 18:12:00 +09:30 коммит произвёл Len Brown
Родитель 1e384cb0f9
Коммит 14485c5727
1 изменённых файлов: 0 добавлений и 3 удалений

Просмотреть файл

@ -745,9 +745,6 @@ static int acpi_fujitsu_remove(struct acpi_device *device, int type)
fujitsu = acpi_driver_data(device);
if (!device || !acpi_driver_data(device))
return -EINVAL;
fujitsu->acpi_handle = NULL;
return 0;