Skip to contentSkip to conversation

acpi/battery.c: remove dead code

PATCH Applied Adrian Bunk 3 participants 3 messages Oct 24, 2007 – Oct 25, 2007 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/battery.c: remove dead code

After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead code.

Spotted by the Coverity checker.

---

drivers/acpi/battery.c renamed from drivers/acpi/battery.c.old +0 -4
@@ -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;
#1 lore raw
Quoted 6 lines · Adrian Bunk

After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead code.

Spotted by the Coverity checker.

Acked. Thanks.

Quoted 29 lines

---

drivers/acpi/battery.c renamed from drivers/acpi/battery.c.old +0 -5
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

reviewer Applied
#2 lore raw

Applied.

thanks,
-len

Quoted 44 lines · Alexey Starikovskiy
Quoted 6 lines · Adrian Bunk

After commit f1d4661abe05d0a2c014166042d15ed8b69ae8f2 this was dead code.

Spotted by the Coverity checker.

Acked. Thanks.

Quoted 25 lines

---

drivers/acpi/battery.c renamed from drivers/acpi/battery.c.old +0 -5
@@ -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;
 
-
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/