Commit 87be8932 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

frv: kill used but uninitialized variable

Commit 6afe1a1f ("PM: Remove legacy PM") removed the initialization
of retval, causing:

  arch/frv/kernel/pm.c: In function 'sysctl_pm_do_suspend':
  arch/frv/kernel/pm.c:165:5: warning: 'retval' may be used uninitialized in this function [-Wuninitialized]

Remove the variable completely to fix this, and convert to a proper
switch (...) { ... } construct to improve readability.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8f243af4
...@@ -153,23 +153,22 @@ static int user_atoi(char __user *ubuf, size_t len) ...@@ -153,23 +153,22 @@ static int user_atoi(char __user *ubuf, size_t len)
static int sysctl_pm_do_suspend(ctl_table *ctl, int write, static int sysctl_pm_do_suspend(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos) void __user *buffer, size_t *lenp, loff_t *fpos)
{ {
int retval, mode; int mode;
if (*lenp <= 0) if (*lenp <= 0)
return -EIO; return -EIO;
mode = user_atoi(buffer, *lenp); mode = user_atoi(buffer, *lenp);
if ((mode != 1) && (mode != 5)) switch (mode) {
return -EINVAL; case 1:
return pm_do_suspend();
if (retval == 0) { case 5:
if (mode == 5) return pm_do_bus_sleep();
retval = pm_do_bus_sleep();
else
retval = pm_do_suspend();
}
return retval; default:
return -EINVAL;
}
} }
static int try_set_cmode(int new_cmode) static int try_set_cmode(int new_cmode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment