From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Carpenter <error27@gmail.com>,
corbet@lwn.net, eteo@redhat.com, Julia Lawall <julia@diku.dk>
Subject: [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks
Date: Wed, 29 Jul 2009 22:14:30 +0200 [thread overview]
Message-ID: <200907292214.31038.bzolnier@gmail.com> (raw)
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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 <error27@gmail.com>
Cc: corbet@lwn.net
Cc: eteo@redhat.com
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/platform/x86/fujitsu-laptop.c | 6 ------
1 file changed, 6 deletions(-)
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");
next reply other threads:[~2009-07-29 20:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 20:14 Bartlomiej Zolnierkiewicz [this message]
2009-07-30 7:43 ` [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks Jonathan Woithe
2009-07-30 7:43 ` Jonathan Woithe
2009-07-30 11:12 ` Bartlomiej Zolnierkiewicz
2009-07-31 3:57 ` Jonathan Woithe
2009-07-31 3:57 ` Jonathan Woithe
2009-07-30 7:55 ` [PATCH] fujitsu-laptop: consolidated fixes (NULL pointer checks, [un]registration fixes, etc) Jonathan Woithe
2009-07-30 7:55 ` Jonathan Woithe
2009-07-30 12:08 ` Bartlomiej Zolnierkiewicz
2009-07-31 4:04 ` Jonathan Woithe
2009-07-31 4:04 ` Jonathan Woithe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907292214.31038.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=corbet@lwn.net \
--cc=error27@gmail.com \
--cc=eteo@redhat.com \
--cc=julia@diku.dk \
--cc=jwoithe@physics.adelaide.edu.au \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.