From: Pavel Machek <pavel@ucw.cz>

This simplifies error handling in acpi/sleep/proc.c.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/acpi/sleep/proc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -puN drivers/acpi/sleep/proc.c~acpi-proc-simplify-error-handling drivers/acpi/sleep/proc.c
--- 25/drivers/acpi/sleep/proc.c~acpi-proc-simplify-error-handling	2004-09-11 16:21:12.485626712 -0700
+++ 25-akpm/drivers/acpi/sleep/proc.c	2004-09-11 16:21:12.489626104 -0700
@@ -57,7 +57,8 @@ acpi_system_write_sleep (
 	int	error = 0;
 
 	if (count > sizeof(str) - 1)
-		goto Done;
+		return -EIO;
+
 	memset(str,0,sizeof(str));
 	if (copy_from_user(str, buffer, count))
 		return -EFAULT;
@@ -65,17 +66,16 @@ acpi_system_write_sleep (
 	/* Check for S4 bios request */
 	if (!strcmp(str,"4b")) {
 		error = acpi_suspend(4);
-		goto Done;
+		return error ? error : count;
 	}
 	state = simple_strtoul(str, NULL, 0);
 #ifdef CONFIG_SOFTWARE_SUSPEND
 	if (state == 4) {
-		software_suspend();
-		goto Done;
+		error = software_suspend();
+		return error ? error : count;
 	}
 #endif
 	error = acpi_suspend(state);
- Done:
 	return error ? error : count;
 }
 
_