Commit f23a5e14 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM: Fix PM QOS's user mode interface to work with ASCII input
  PM / Hibernate: Update kerneldoc comments in hibernate.c
  PM / Hibernate: Remove arch_prepare_suspend()
  PM / Hibernate: Update some comments in core hibernate code
parents d24c2af4 0775a60a
/* suspend.h: suspension stuff
*
* Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_SUSPEND_H
#define _ASM_SUSPEND_H
static inline int arch_prepare_suspend(void)
{
return 0;
}
#endif /* _ASM_SUSPEND_H */
#ifndef __ASM_SUSPEND_H #ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H #define __ASM_SUSPEND_H
static inline int arch_prepare_suspend(void) { return 0; }
/* References to section boundaries */ /* References to section boundaries */
extern const void __nosave_begin, __nosave_end; extern const void __nosave_begin, __nosave_end;
......
#ifndef __ASM_POWERPC_SUSPEND_H
#define __ASM_POWERPC_SUSPEND_H
static inline int arch_prepare_suspend(void) { return 0; }
#endif /* __ASM_POWERPC_SUSPEND_H */
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
*/ */
#include <linux/sched.h> #include <linux/sched.h>
#include <asm/suspend.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/current.h> #include <asm/current.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
......
#ifndef __ASM_S390_SUSPEND_H
#define __ASM_S390_SUSPEND_H
static inline int arch_prepare_suspend(void)
{
return 0;
}
#endif
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/notifier.h> #include <linux/notifier.h>
static inline int arch_prepare_suspend(void) { return 0; }
#include <asm/ptrace.h> #include <asm/ptrace.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#define __UNICORE_SUSPEND_H__ #define __UNICORE_SUSPEND_H__
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
static inline int arch_prepare_suspend(void) { return 0; }
#include <asm/ptrace.h> #include <asm/ptrace.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <asm/desc.h> #include <asm/desc.h>
#include <asm/i387.h> #include <asm/i387.h>
static inline int arch_prepare_suspend(void) { return 0; }
/* image of the saved processor state */ /* image of the saved processor state */
struct saved_context { struct saved_context {
u16 es, fs, gs, ss; u16 es, fs, gs, ss;
......
...@@ -9,11 +9,6 @@ ...@@ -9,11 +9,6 @@
#include <asm/desc.h> #include <asm/desc.h>
#include <asm/i387.h> #include <asm/i387.h>
static inline int arch_prepare_suspend(void)
{
return 0;
}
/* /*
* Image of the saved processor state, used by the low level ACPI suspend to * Image of the saved processor state, used by the low level ACPI suspend to
* RAM code and by the low level hibernation code. * RAM code and by the low level hibernation code.
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
...@@ -404,24 +405,36 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, ...@@ -404,24 +405,36 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos) size_t count, loff_t *f_pos)
{ {
s32 value; s32 value;
int x;
char ascii_value[11];
struct pm_qos_request_list *pm_qos_req; struct pm_qos_request_list *pm_qos_req;
if (count == sizeof(s32)) { if (count == sizeof(s32)) {
if (copy_from_user(&value, buf, sizeof(s32))) if (copy_from_user(&value, buf, sizeof(s32)))
return -EFAULT; return -EFAULT;
} else if (count == 11) { /* len('0x12345678/0') */ } else if (count <= 11) { /* ASCII perhaps? */
if (copy_from_user(ascii_value, buf, 11)) char ascii_value[11];
unsigned long int ulval;
int ret;
if (copy_from_user(ascii_value, buf, count))
return -EFAULT; return -EFAULT;
if (strlen(ascii_value) != 10)
return -EINVAL; if (count > 10) {
x = sscanf(ascii_value, "%x", &value); if (ascii_value[10] == '\n')
if (x != 1) ascii_value[10] = '\0';
else
return -EINVAL;
} else {
ascii_value[count] = '\0';
}
ret = strict_strtoul(ascii_value, 16, &ulval);
if (ret) {
pr_debug("%s, 0x%lx, 0x%x\n", ascii_value, ulval, ret);
return -EINVAL; return -EINVAL;
pr_debug("%s, %d, 0x%x\n", ascii_value, x, value); }
} else value = (s32)lower_32_bits(ulval);
} else {
return -EINVAL; return -EINVAL;
}
pm_qos_req = filp->private_data; pm_qos_req = filp->private_data;
pm_qos_update_request(pm_qos_req, value); pm_qos_update_request(pm_qos_req, value);
......
This diff is collapsed.
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