Re: [2.6 patch] acpi/battery.c: remove dead code

Previous thread: [2.6 patch] make kernel/sched.c:account_guest_time() static by Adrian Bunk on Wednesday, October 24, 2007 - 9:25 am. (4 messages)

Next thread: [2.6 patch] some overdue I2C driver removal by Adrian Bunk on Wednesday, October 24, 2007 - 9:25 am. (10 messages)
From: Adrian Bunk
Date: Wednesday, October 24, 2007 - 9:25 am

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;

-

From: Alexey Starikovskiy
Date: Wednesday, October 24, 2007 - 10:18 am

From: Len Brown
Date: Thursday, October 25, 2007 - 1:38 pm

Applied.

thanks,
-len

-

Previous thread: [2.6 patch] make kernel/sched.c:account_guest_time() static by Adrian Bunk on Wednesday, October 24, 2007 - 9:25 am. (4 messages)

Next thread: [2.6 patch] some overdue I2C driver removal by Adrian Bunk on Wednesday, October 24, 2007 - 9:25 am. (10 messages)