mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks
@ 2009-07-31  8:43 Jonathan Woithe
  2009-08-27 22:56 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Woithe @ 2009-07-31  8:43 UTC (permalink / raw)
  To: linux-acpi
  Cc: Jonathan Woithe, linux-kernel, julia, bzolnier, error27, corbet, eteo

[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 <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>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>

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

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

* Re: [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks
  2009-07-31  8:43 [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks Jonathan Woithe
@ 2009-08-27 22:56 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2009-08-27 22:56 UTC (permalink / raw)
  To: Jonathan Woithe
  Cc: linux-acpi, linux-kernel, julia, bzolnier, error27, corbet, eteo

applied for 2.6.32

thanks,
Len Brown, Intel Open Source Technology Center


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

end of thread, other threads:[~2009-08-27 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-31  8:43 [PATCH 2/4] fujitsu-laptop: remove superfluous NULL pointer checks Jonathan Woithe
2009-08-27 22:56 ` Len Brown

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

all inboxes | Powered by JetHome®