public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] acpi/battery.c: remove dead code
@ 2007-10-24 16:25 Adrian Bunk
  2007-10-24 17:18 ` Alexey Starikovskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2007-10-24 16:25 UTC (permalink / raw)
  To: Alexey Starikovskiy, Len Brown; +Cc: linux-acpi, linux-kernel

After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead 
code.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/acpi/battery.c.old	2007-10-23 18:44:13.000000000 +0200
+++ linux-2.6/drivers/acpi/battery.c	2007-10-23 18:44:43.000000000 +0200
@@ -550,18 +550,14 @@ static ssize_t acpi_battery_write_alarm(
 	int result = 0;
 	char alarm_string[12] = { '\0' };
 	struct seq_file *m = file->private_data;
 	struct acpi_battery *battery = m->private;
 
 	if (!battery || (count > sizeof(alarm_string) - 1))
 		return -EINVAL;
-	if (result) {
-		result = -ENODEV;
-		goto end;
-	}
 	if (!acpi_battery_present(battery)) {
 		result = -ENODEV;
 		goto end;
 	}
 	if (copy_from_user(alarm_string, buffer, count)) {
 		result = -EFAULT;
 		goto end;


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

* Re: [2.6 patch] acpi/battery.c: remove dead code
  2007-10-24 16:25 [2.6 patch] acpi/battery.c: remove dead code Adrian Bunk
@ 2007-10-24 17:18 ` Alexey Starikovskiy
  2007-10-25 20:38   ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Starikovskiy @ 2007-10-24 17:18 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi, linux-kernel

Adrian Bunk wrote:
> After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead 
> code.
> 
> Spotted by the Coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked. Thanks.
> 
> ---
> --- linux-2.6/drivers/acpi/battery.c.old	2007-10-23 18:44:13.000000000 +0200
> +++ linux-2.6/drivers/acpi/battery.c	2007-10-23 18:44:43.000000000 +0200
> @@ -550,18 +550,14 @@ static ssize_t acpi_battery_write_alarm(
>  	int result = 0;
>  	char alarm_string[12] = { '\0' };
>  	struct seq_file *m = file->private_data;
>  	struct acpi_battery *battery = m->private;
>  
>  	if (!battery || (count > sizeof(alarm_string) - 1))
>  		return -EINVAL;
> -	if (result) {
> -		result = -ENODEV;
> -		goto end;
> -	}
>  	if (!acpi_battery_present(battery)) {
>  		result = -ENODEV;
>  		goto end;
>  	}
>  	if (copy_from_user(alarm_string, buffer, count)) {
>  		result = -EFAULT;
>  		goto end;
> 
> -
> 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
> 


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

* Re: [2.6 patch] acpi/battery.c: remove dead code
  2007-10-24 17:18 ` Alexey Starikovskiy
@ 2007-10-25 20:38   ` Len Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Len Brown @ 2007-10-25 20:38 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Adrian Bunk, Alexey Starikovskiy, linux-acpi, linux-kernel

Applied.

thanks,
-len

On Wednesday 24 October 2007 13:18, Alexey Starikovskiy wrote:
> Adrian Bunk wrote:
> > After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead 
> > code.
> > 
> > Spotted by the Coverity checker.
> > 
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> Acked. Thanks.
> > 
> > ---
> > --- linux-2.6/drivers/acpi/battery.c.old	2007-10-23 18:44:13.000000000 +0200
> > +++ linux-2.6/drivers/acpi/battery.c	2007-10-23 18:44:43.000000000 +0200
> > @@ -550,18 +550,14 @@ static ssize_t acpi_battery_write_alarm(
> >  	int result = 0;
> >  	char alarm_string[12] = { '\0' };
> >  	struct seq_file *m = file->private_data;
> >  	struct acpi_battery *battery = m->private;
> >  
> >  	if (!battery || (count > sizeof(alarm_string) - 1))
> >  		return -EINVAL;
> > -	if (result) {
> > -		result = -ENODEV;
> > -		goto end;
> > -	}
> >  	if (!acpi_battery_present(battery)) {
> >  		result = -ENODEV;
> >  		goto end;
> >  	}
> >  	if (copy_from_user(alarm_string, buffer, count)) {
> >  		result = -EFAULT;
> >  		goto end;
> > 
> > -
> > 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
> > 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

end of thread, other threads:[~2007-10-25 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 16:25 [2.6 patch] acpi/battery.c: remove dead code Adrian Bunk
2007-10-24 17:18 ` Alexey Starikovskiy
2007-10-25 20:38   ` Len Brown

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