aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_ds_timer.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-02-12 00:38:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-12 20:53:34 -0500
commite848b583e03306f5f9b3a66a793c37e3649e04ca (patch)
treed7772ed15a4a4bb8148a936744770b92658273c9 /net/ax25/ax25_ds_timer.c
parent21fab4a86a411c18c6b4d663ae710ca1f6206b3c (diff)
[AX25] ax25_ds_timer: use mod_timer instead of add_timer
This patch changes current use of: init_timer(), add_timer() and del_timer() to setup_timer() with mod_timer(), which should be safer anyway. Reported-by: Jann Traschewski <jann@gmx.de> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25/ax25_ds_timer.c')
-rw-r--r--net/ax25/ax25_ds_timer.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index c4e3b025d21c..2ce79df00680 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -40,13 +40,10 @@ static void ax25_ds_timeout(unsigned long);
40 * 1/10th of a second. 40 * 1/10th of a second.
41 */ 41 */
42 42
43static void ax25_ds_add_timer(ax25_dev *ax25_dev) 43void ax25_ds_setup_timer(ax25_dev *ax25_dev)
44{ 44{
45 struct timer_list *t = &ax25_dev->dama.slave_timer; 45 setup_timer(&ax25_dev->dama.slave_timer, ax25_ds_timeout,
46 t->data = (unsigned long) ax25_dev; 46 (unsigned long)ax25_dev);
47 t->function = &ax25_ds_timeout;
48 t->expires = jiffies + HZ;
49 add_timer(t);
50} 47}
51 48
52void ax25_ds_del_timer(ax25_dev *ax25_dev) 49void ax25_ds_del_timer(ax25_dev *ax25_dev)
@@ -60,10 +57,9 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
60 if (ax25_dev == NULL) /* paranoia */ 57 if (ax25_dev == NULL) /* paranoia */
61 return; 58 return;
62 59
63 del_timer(&ax25_dev->dama.slave_timer);
64 ax25_dev->dama.slave_timeout = 60 ax25_dev->dama.slave_timeout =
65 msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10; 61 msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
66 ax25_ds_add_timer(ax25_dev); 62 mod_timer(&ax25_dev->dama.slave_timer, jiffies + HZ);
67} 63}
68 64
69/* 65/*