From 0d0749f808112d6dc0c1d076058f5f9de29f5443 Mon Sep 17 00:00:00 2001 From: hartkopp Date: Fri, 16 Nov 2007 10:08:00 +0000 Subject: [PATCH] Use of setup_timer(). git-svn-id: svn://svn.berlios.de//socketcan/trunk@558 030b6a49-0b11-0410-94ab-b0dab22257f2 --- kernel/2.6/net/can/bcm.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/2.6/net/can/bcm.c b/kernel/2.6/net/can/bcm.c index 41b0902..5769bce 100644 --- a/kernel/2.6/net/can/bcm.c +++ b/kernel/2.6/net/can/bcm.c @@ -938,18 +938,13 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, op->sk = sk; op->ifindex = ifindex; - /* initialize uninitialized (kmalloc) structure */ - init_timer(&op->timer); + /* initialize uninitialized (kzalloc) structure */ + setup_timer(&op->timer, bcm_tx_timeout_handler, + (unsigned long)op); /* currently unused in tx_ops */ init_timer(&op->thrtimer); - /* handler for tx_ops */ - op->timer.function = bcm_tx_timeout_handler; - - /* timer.data points to this op-structure */ - op->timer.data = (unsigned long)op; - /* add this bcm_op to the list of the tx_ops */ list_add(&op->list, &bo->tx_ops); @@ -1105,22 +1100,12 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, op->ifindex = ifindex; /* initialize uninitialized (kzalloc) structure */ - init_timer(&op->timer); + setup_timer(&op->timer, bcm_rx_timeout_handler, + (unsigned long)op); /* init throttle timer for RX_CHANGED */ - init_timer(&op->thrtimer); - - /* handler for rx timeouts */ - op->timer.function = bcm_rx_timeout_handler; - - /* timer.data points to this op-structure */ - op->timer.data = (unsigned long)op; - - /* handler for RX_CHANGED throttle timeouts */ - op->thrtimer.function = bcm_rx_thr_handler; - - /* timer.data points to this op-structure */ - op->thrtimer.data = (unsigned long)op; + setup_timer(&op->thrtimer, bcm_rx_thr_handler, + (unsigned long)op); /* mark disabled timer */ op->thrtimer.expires = 0; -- 2.39.2