From patchwork Wed Jul 29 20:14:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 38228 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 n6TKPerv026877 for ; Wed, 29 Jul 2009 20:25:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755826AbZG2UZi (ORCPT ); Wed, 29 Jul 2009 16:25:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755798AbZG2UZi (ORCPT ); Wed, 29 Jul 2009 16:25:38 -0400 Received: from mail-fx0-f228.google.com ([209.85.220.228]:34548 "EHLO mail-fx0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755809AbZG2UZh (ORCPT ); Wed, 29 Jul 2009 16:25:37 -0400 X-Greylist: delayed 499 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 Jul 2009 16:25:37 EDT Received: by fxm28 with SMTP id 28so221968fxm.17 for ; Wed, 29 Jul 2009 13:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:mime-version:content-type:content-transfer-encoding :content-disposition:message-id; bh=6UO+muQnNsIOWKGgNwA8XkF6OEf8aWaTc5Mfa5AYMN4=; b=Q7ie4LGGVLpL5UdyThAkdEgfbAjfNo3zdxMjS3sHDrw5gm9nDcoGdEAAkq1B4xTaXz YNYrKXgeKublSQaEx+nIGXYtI2rmZPtyuJiPcTvlSMFLUzpuThCTIB+fECCCE+cuI4eY 0wAU5rFZgFWQYKky4gUD3gLWsbnY1H/Gfwjqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=Gm87E2d29oGB6K0BZQ6eQ1fAC6DuRr4U6z0mmKrYhcxwVprYWBt/gCTmkkETFlvAnS WLgMw/Hzg/y/A09aBFDTUS2HXei/vFJ2KLVWb/m0czrbZgACflUcq9uRx7hczZJbu/6z beg8H15MCUUbaDnDaY5yIb7MEq7Dw7HlWo+Yk= Received: by 10.103.121.16 with SMTP id y16mr150236mum.6.1248898638129; Wed, 29 Jul 2009 13:17:18 -0700 (PDT) Received: from localhost.localdomain (chello089077034197.chello.pl [89.77.34.197]) by mx.google.com with ESMTPS id 25sm2652797mul.23.2009.07.29.13.17.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Jul 2009 13:17:17 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: Jonathan Woithe Subject: [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks Date: Wed, 29 Jul 2009 22:14:30 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.31-rc3-next-20090722-04415-ge5aa24a-dirty; KDE/4.2.4; i686; ; ) Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter , corbet@lwn.net, eteo@redhat.com, Julia Lawall MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907292214.31038.bzolnier@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] 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 --- drivers/platform/x86/fujitsu-laptop.c | 6 ------ 1 file changed, 6 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 Index: b/drivers/platform/x86/fujitsu-laptop.c =================================================================== --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -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");