diff options
| author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-11-07 04:01:14 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:56 -0500 |
| commit | 01a527ec7c62efea601a39f0cd8e6a8517259014 (patch) | |
| tree | 153c92030c0d77b7c4a38fd978ad9f089b14df92 | |
| parent | bc874d174b224c016adac85fc9dd6da1161ffc57 (diff) | |
[PATCH] drivers/acpi: fix-up schedule_timeout() usage
Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
msecs_to_jiffies() instead of direct HZ division to avoid rounding errors.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | drivers/acpi/osl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index d528c750a380..e3cd0b16031a 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -313,8 +313,7 @@ acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) | |||
| 313 | 313 | ||
| 314 | void acpi_os_sleep(acpi_integer ms) | 314 | void acpi_os_sleep(acpi_integer ms) |
| 315 | { | 315 | { |
| 316 | current->state = TASK_INTERRUPTIBLE; | 316 | schedule_timeout_interruptible(msecs_to_jiffies(ms)); |
| 317 | schedule_timeout(((signed long)ms * HZ) / 1000); | ||
| 318 | } | 317 | } |
| 319 | 318 | ||
| 320 | EXPORT_SYMBOL(acpi_os_sleep); | 319 | EXPORT_SYMBOL(acpi_os_sleep); |
| @@ -838,8 +837,7 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) | |||
| 838 | 837 | ||
| 839 | ret = down_trylock(sem); | 838 | ret = down_trylock(sem); |
| 840 | for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { | 839 | for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { |
| 841 | current->state = TASK_INTERRUPTIBLE; | 840 | schedule_timeout_interruptible(1); |
| 842 | schedule_timeout(1); | ||
| 843 | ret = down_trylock(sem); | 841 | ret = down_trylock(sem); |
| 844 | } | 842 | } |
| 845 | 843 | ||
