From: Julia Lawall Date: Fri, 31 Jul 2009 08:42:00 +0000 (+0930) Subject: fujitsu-laptop: Correct redundant test X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=14485c57270e8f3de2a25abaf93bae5712c97e9e;p=deliverable%2Flinux.git 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/) // @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 ) // Signed-off-by: Julia Lawall Acked-by: Jonathan Woithe Signed-off-by: Len Brown --- diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 4c8897a84c68..0d42f444a447 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -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;