From patchwork Fri Jul 31 08:43:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Woithe X-Patchwork-Id: 38477 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 n6V8iRZp025932 for ; Fri, 31 Jul 2009 08:44:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750945AbZGaIoZ (ORCPT ); Fri, 31 Jul 2009 04:44:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751338AbZGaIoZ (ORCPT ); Fri, 31 Jul 2009 04:44:25 -0400 Received: from adelphi.physics.adelaide.edu.au ([129.127.102.1]:51418 "EHLO adelphi.physics.adelaide.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbZGaIoY (ORCPT ); Fri, 31 Jul 2009 04:44:24 -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 n6V8hv9J020383; Fri, 31 Jul 2009 18:13:57 +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 n6V8hvwe006736; Fri, 31 Jul 2009 18:13:57 +0930 Received: (from jwoithe@localhost) by mercury.physics.adelaide.edu.au (8.13.4/8.13.4/Submit) id n6V8huKA006735; Fri, 31 Jul 2009 18:13:56 +0930 From: Jonathan Woithe Message-Id: <200907310843.n6V8huKA006735@mercury.physics.adelaide.edu.au> Subject: [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks To: linux-acpi@vger.kernel.org Date: Fri, 31 Jul 2009 18:13:56 +0930 (CST) Cc: jwoithe@physics.adelaide.edu.au (Jonathan Woithe), linux-kernel@vger.kernel.org, julia@diku.dk, bzolnier@gmail.com, error27@gmail.com, corbet@lwn.net, eteo@redhat.com 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 [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks This takes care of the following entries from Dan's list: drivers/platform/x86/fujitsu-laptop.c +327 set_lcd_level(13) warning: variable derefenced before check 'fujitsu' drivers/platform/x86/fujitsu-laptop.c +358 set_lcd_level_alt(13) warning: variable derefenced before check 'fujitsu' Reported-by: Dan Carpenter Cc: corbet@lwn.net Cc: eteo@redhat.com Cc: Julia Lawall Signed-off-by: Bartlomiej Zolnierkiewicz 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 17:13:01.160777027 +0930 +++ b/drivers/platform/x86/fujitsu-laptop.c 2009-07-31 17:14:09.975776844 +0930 @@ -324,9 +324,6 @@ static int set_lcd_level(int level) if (level < 0 || level >= fujitsu->max_brightness) return -EINVAL; - if (!fujitsu) - return -EINVAL; - status = acpi_get_handle(fujitsu->acpi_handle, "SBLL", &handle); if (ACPI_FAILURE(status)) { vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBLL not present\n"); @@ -355,9 +352,6 @@ static int set_lcd_level_alt(int level) if (level < 0 || level >= fujitsu->max_brightness) return -EINVAL; - if (!fujitsu) - return -EINVAL; - status = acpi_get_handle(fujitsu->acpi_handle, "SBL2", &handle); if (ACPI_FAILURE(status)) { vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBL2 not present\n");