Commit 368a4b59 authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds

[PATCH] synclink.c kernel janitor changes

Uses msecs_to_jiffies() instead of the custom jiffies_from_ms().
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e5fc1f67
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/time.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/tty.h> #include <linux/tty.h>
...@@ -443,8 +444,6 @@ static int tx_abort(MGSLPC_INFO *info); ...@@ -443,8 +444,6 @@ static int tx_abort(MGSLPC_INFO *info);
static int set_rxenable(MGSLPC_INFO *info, int enable); static int set_rxenable(MGSLPC_INFO *info, int enable);
static int wait_events(MGSLPC_INFO *info, int __user *mask); static int wait_events(MGSLPC_INFO *info, int __user *mask);
#define jiffies_from_ms(a) ((((a) * HZ)/1000)+1)
static MGSLPC_INFO *mgslpc_device_list = NULL; static MGSLPC_INFO *mgslpc_device_list = NULL;
static int mgslpc_device_count = 0; static int mgslpc_device_count = 0;
...@@ -3650,7 +3649,7 @@ void tx_start(MGSLPC_INFO *info) ...@@ -3650,7 +3649,7 @@ void tx_start(MGSLPC_INFO *info)
} else { } else {
info->tx_active = 1; info->tx_active = 1;
tx_ready(info); tx_ready(info);
info->tx_timer.expires = jiffies + jiffies_from_ms(5000); info->tx_timer.expires = jiffies + msecs_to_jiffies(5000);
add_timer(&info->tx_timer); add_timer(&info->tx_timer);
} }
} }
...@@ -4110,7 +4109,7 @@ BOOLEAN irq_test(MGSLPC_INFO *info) ...@@ -4110,7 +4109,7 @@ BOOLEAN irq_test(MGSLPC_INFO *info)
end_time=100; end_time=100;
while(end_time-- && !info->irq_occurred) { while(end_time-- && !info->irq_occurred) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(jiffies_from_ms(10)); schedule_timeout(msecs_to_jiffies(10));
} }
info->testing_irq = FALSE; info->testing_irq = FALSE;
......
...@@ -453,8 +453,6 @@ typedef struct _synclinkmp_info { ...@@ -453,8 +453,6 @@ typedef struct _synclinkmp_info {
#define CRCE BIT2 #define CRCE BIT2
#define jiffies_from_ms(a) ((((a) * HZ)/1000)+1)
/* /*
* Global linked list of SyncLink devices * Global linked list of SyncLink devices
*/ */
...@@ -2759,7 +2757,7 @@ static int startup(SLMP_INFO * info) ...@@ -2759,7 +2757,7 @@ static int startup(SLMP_INFO * info)
change_params(info); change_params(info);
info->status_timer.expires = jiffies + jiffies_from_ms(10); info->status_timer.expires = jiffies + msecs_to_jiffies(10);
add_timer(&info->status_timer); add_timer(&info->status_timer);
if (info->tty) if (info->tty)
...@@ -4317,7 +4315,7 @@ void tx_start(SLMP_INFO *info) ...@@ -4317,7 +4315,7 @@ void tx_start(SLMP_INFO *info)
write_reg(info, TXDMA + DIR, 0x40); /* enable Tx DMA interrupts (EOM) */ write_reg(info, TXDMA + DIR, 0x40); /* enable Tx DMA interrupts (EOM) */
write_reg(info, TXDMA + DSR, 0xf2); /* clear Tx DMA IRQs, enable Tx DMA */ write_reg(info, TXDMA + DSR, 0xf2); /* clear Tx DMA IRQs, enable Tx DMA */
info->tx_timer.expires = jiffies + jiffies_from_ms(5000); info->tx_timer.expires = jiffies + msecs_to_jiffies(5000);
add_timer(&info->tx_timer); add_timer(&info->tx_timer);
} }
else { else {
...@@ -5205,7 +5203,7 @@ int irq_test(SLMP_INFO *info) ...@@ -5205,7 +5203,7 @@ int irq_test(SLMP_INFO *info)
timeout=100; timeout=100;
while( timeout-- && !info->irq_occurred ) { while( timeout-- && !info->irq_occurred ) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(jiffies_from_ms(10)); schedule_timeout(msecs_to_jiffies(10));
} }
spin_lock_irqsave(&info->lock,flags); spin_lock_irqsave(&info->lock,flags);
...@@ -5356,7 +5354,7 @@ int loopback_test(SLMP_INFO *info) ...@@ -5356,7 +5354,7 @@ int loopback_test(SLMP_INFO *info)
/* Set a timeout for waiting for interrupt. */ /* Set a timeout for waiting for interrupt. */
for ( timeout = 100; timeout; --timeout ) { for ( timeout = 100; timeout; --timeout ) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(jiffies_from_ms(10)); schedule_timeout(msecs_to_jiffies(10));
if (rx_get_frame(info)) { if (rx_get_frame(info)) {
rc = TRUE; rc = TRUE;
...@@ -5612,7 +5610,7 @@ void status_timeout(unsigned long context) ...@@ -5612,7 +5610,7 @@ void status_timeout(unsigned long context)
info->status_timer.data = (unsigned long)info; info->status_timer.data = (unsigned long)info;
info->status_timer.function = status_timeout; info->status_timer.function = status_timeout;
info->status_timer.expires = jiffies + jiffies_from_ms(10); info->status_timer.expires = jiffies + msecs_to_jiffies(10);
add_timer(&info->status_timer); add_timer(&info->status_timer);
} }
......
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