diff mbox

[1/4] fujitsu-laptop: Correct redundant test

Message ID 200907310842.n6V8g0vI006725@mercury.physics.adelaide.edu.au (mailing list archive)
State Accepted
Headers show

Commit Message

Jonathan Woithe July 31, 2009, 8:42 a.m. UTC
From: Julia Lawall <julia@diku.dk>

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>

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Len Brown Aug. 27, 2009, 10:56 p.m. UTC | #1
applied for 2.6.32

thanks,
Len Brown, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/platform/x86/fujitsu-laptop.c	2009-07-31 16:55:09.389775000 +0930
+++ b/drivers/platform/x86/fujitsu-laptop.c	2009-07-31 17:13:01.160777027 +0930
@@ -745,9 +745,6 @@  static int acpi_fujitsu_remove(struct ac
 
 	fujitsu = acpi_driver_data(device);
 
-	if (!device || !acpi_driver_data(device))
-		return -EINVAL;
-
 	fujitsu->acpi_handle = NULL;
 
 	return 0;