Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed May 27, 2011
2 parents d24c2af + 0775a60 commit f23a5e1
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 167 deletions.
20 changes: 0 additions & 20 deletions arch/frv/include/asm/suspend.h

This file was deleted.

2 changes: 0 additions & 2 deletions arch/mips/include/asm/suspend.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H

static inline int arch_prepare_suspend(void) { return 0; }

/* References to section boundaries */
extern const void __nosave_begin, __nosave_end;

Expand Down
6 changes: 0 additions & 6 deletions arch/powerpc/include/asm/suspend.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/powerpc/kernel/swsusp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

#include <linux/sched.h>
#include <asm/suspend.h>
#include <asm/system.h>
#include <asm/current.h>
#include <asm/mmu_context.h>
Expand Down
10 changes: 0 additions & 10 deletions arch/s390/include/asm/suspend.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/sh/include/asm/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#ifndef __ASSEMBLY__
#include <linux/notifier.h>
static inline int arch_prepare_suspend(void) { return 0; }

#include <asm/ptrace.h>

Expand Down
1 change: 0 additions & 1 deletion arch/unicore32/include/asm/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define __UNICORE_SUSPEND_H__

#ifndef __ASSEMBLY__
static inline int arch_prepare_suspend(void) { return 0; }

#include <asm/ptrace.h>

Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/suspend_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include <asm/desc.h>
#include <asm/i387.h>

static inline int arch_prepare_suspend(void) { return 0; }

/* image of the saved processor state */
struct saved_context {
u16 es, fs, gs, ss;
Expand Down
5 changes: 0 additions & 5 deletions arch/x86/include/asm/suspend_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
#include <asm/desc.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
* RAM code and by the low level hibernation code.
Expand Down
33 changes: 23 additions & 10 deletions kernel/pm_qos_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <linux/string.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/kernel.h>

#include <linux/uaccess.h>

Expand Down Expand Up @@ -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)
{
s32 value;
int x;
char ascii_value[11];
struct pm_qos_request_list *pm_qos_req;

if (count == sizeof(s32)) {
if (copy_from_user(&value, buf, sizeof(s32)))
return -EFAULT;
} else if (count == 11) { /* len('0x12345678/0') */
if (copy_from_user(ascii_value, buf, 11))
} else if (count <= 11) { /* ASCII perhaps? */
char ascii_value[11];
unsigned long int ulval;
int ret;

if (copy_from_user(ascii_value, buf, count))
return -EFAULT;
if (strlen(ascii_value) != 10)
return -EINVAL;
x = sscanf(ascii_value, "%x", &value);
if (x != 1)

if (count > 10) {
if (ascii_value[10] == '\n')
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;
pr_debug("%s, %d, 0x%x\n", ascii_value, x, value);
} else
}
value = (s32)lower_32_bits(ulval);
} else {
return -EINVAL;
}

pm_qos_req = filp->private_data;
pm_qos_update_request(pm_qos_req, value);
Expand Down
Loading

0 comments on commit f23a5e1

Please sign in to comment.