public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks
@ 2009-07-29 20:14 Bartlomiej Zolnierkiewicz
  2009-07-30  7:43 ` Jonathan Woithe
  2009-07-30  7:55 ` [PATCH] fujitsu-laptop: consolidated fixes (NULL pointer checks, [un]registration fixes, etc) Jonathan Woithe
  0 siblings, 2 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-07-29 20:14 UTC (permalink / raw)
  To: Jonathan Woithe
  Cc: linux-acpi, linux-kernel, Dan Carpenter, corbet, eteo,
	Julia Lawall

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");

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-31  4:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 20:14 [PATCH] fujitsu-laptop: remove superfluous NULL pointer checks Bartlomiej Zolnierkiewicz
2009-07-30  7:43 ` Jonathan Woithe
2009-07-30 11:12   ` Bartlomiej Zolnierkiewicz
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 12:08   ` Bartlomiej Zolnierkiewicz
2009-07-31  4:04     ` Jonathan Woithe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox