From patchwork Fri Jul 31 08:42:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Woithe X-Patchwork-Id: 38475 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 n6V8gC3g025627 for ; Fri, 31 Jul 2009 08:42:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbZGaImJ (ORCPT ); Fri, 31 Jul 2009 04:42:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751338AbZGaImJ (ORCPT ); Fri, 31 Jul 2009 04:42:09 -0400 Received: from adelphi.physics.adelaide.edu.au ([129.127.102.1]:51309 "EHLO adelphi.physics.adelaide.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330AbZGaImI (ORCPT ); Fri, 31 Jul 2009 04:42:08 -0400 Received: from mercury.physics.adelaide.edu.au (IDENT:0@mercury [129.127.102.44]) by adelphi.physics.adelaide.edu.au (8.13.7/8.13.7/UofA-Physics-1.0) with ESMTP id n6V8g0vH019681; Fri, 31 Jul 2009 18:12:01 +0930 Received: from mercury.physics.adelaide.edu.au (IDENT:7157@localhost [127.0.0.1]) by mercury.physics.adelaide.edu.au (8.13.4/8.13.4) with ESMTP id n6V8g07e006726; Fri, 31 Jul 2009 18:12:00 +0930 Received: (from jwoithe@localhost) by mercury.physics.adelaide.edu.au (8.13.4/8.13.4/Submit) id n6V8g0vI006725; Fri, 31 Jul 2009 18:12:00 +0930 From: Jonathan Woithe Message-Id: <200907310842.n6V8g0vI006725@mercury.physics.adelaide.edu.au> Subject: [PATCH 1/4] fujitsu-laptop: Correct redundant test To: linux-acpi@vger.kernel.org Date: Fri, 31 Jul 2009 18:12:00 +0930 (CST) Cc: jwoithe@physics.adelaide.edu.au (Jonathan Woithe), linux-kernel@vger.kernel.org, julia@diku.dk, bzolnier@gmail.com, kernel-janitors@vger.kernel.org X-Mailer: ELM [version 2.5 PL6] 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 Acked-by: Jonathan Woithe --- 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 --- 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;