diff options
author | Julia Lawall <julia@diku.dk> | 2009-07-31 04:42:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-08-28 15:17:08 -0400 |
commit | 14485c57270e8f3de2a25abaf93bae5712c97e9e (patch) | |
tree | 4d9a05bc9b88d5722088c1f816af64ba7a47c0c2 /drivers/platform/x86/fujitsu-laptop.c | |
parent | 1e384cb0f9a940f2a431d1708f963987e61d71e3 (diff) |
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>
Diffstat (limited to 'drivers/platform/x86/fujitsu-laptop.c')
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 3 |
1 files changed, 0 insertions, 3 deletions
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) | |||
745 | 745 | ||
746 | fujitsu = acpi_driver_data(device); | 746 | fujitsu = acpi_driver_data(device); |
747 | 747 | ||
748 | if (!device || !acpi_driver_data(device)) | ||
749 | return -EINVAL; | ||
750 | |||
751 | fujitsu->acpi_handle = NULL; | 748 | fujitsu->acpi_handle = NULL; |
752 | 749 | ||
753 | return 0; | 750 | return 0; |