[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907310842.n6V8g0vI006725@mercury.physics.adelaide.edu.au>
Date: Fri, 31 Jul 2009 18:12:00 +0930 (CST)
From: Jonathan Woithe <jwoithe@...sics.adelaide.edu.au>
To: linux-acpi@...r.kernel.org
Cc: jwoithe@...sics.adelaide.edu.au (Jonathan Woithe),
linux-kernel@...r.kernel.org, julia@...u.dk, bzolnier@...il.com,
kernel-janitors@...r.kernel.org
Subject: [PATCH 1/4] fujitsu-laptop: Correct redundant test
From: Julia Lawall <julia@...u.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@...u.dk>
Acked-by: Jonathan Woithe <jwoithe@...sics.adelaide.edu.au>
--- 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists