From patchwork Mon Jul 27 16:14:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 37582 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6RGMUg1003612 for ; Mon, 27 Jul 2009 16:22:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbZG0QTw (ORCPT ); Mon, 27 Jul 2009 12:19:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752254AbZG0QTd (ORCPT ); Mon, 27 Jul 2009 12:19:33 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:49184 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbZG0QTb (ORCPT ); Mon, 27 Jul 2009 12:19:31 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 3445252C575; Mon, 27 Jul 2009 18:19:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KjqCP-WeG2TP; Mon, 27 Jul 2009 18:19:29 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id E203152C5A6; Mon, 27 Jul 2009 18:14:11 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 599976DF89F; Mon, 27 Jul 2009 18:13:28 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id CD377154D01; Mon, 27 Jul 2009 18:14:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id CC33D1547DF; Mon, 27 Jul 2009 18:14:11 +0200 (CEST) Date: Mon, 27 Jul 2009 18:14:11 +0200 (CEST) From: Julia Lawall To: jwoithe@physics.adelaide.edu.au, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 6/12] drivers/platform/x86: Correct redundant test Message-ID: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Julia Lawall 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 --- drivers/platform/x86/fujitsu-laptop.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) -- 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 --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 218b9a1..5306901 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;