Messages in this thread Patch in this message | | | Date | Tue, 9 Mar 2004 11:08:59 -0800 | Subject | [PATCH 2.6 IrDA] (9/14) irda_start_timer inline | From | Jean Tourrilhes <> |
| |
ir264_irsyms_09_timer.diff : ~~~~~~~~~~~~~~~~~~~~~~~~~ <Patch from Stephen Hemminger> (9/14) irda_start_timer inline
Make irda_start_timer inline rather than exporting, because it probably takes more code to call than just put inline
diff -u -p -r linux/include/net/irda.s8/timer.h linux/include/net/irda/timer.h --- linux/include/net/irda.s8/timer.h Wed Mar 3 17:01:37 2004 +++ linux/include/net/irda/timer.h Mon Mar 8 19:15:41 2004 @@ -71,8 +71,18 @@ struct lap_cb; typedef void (*TIMER_CALLBACK)(void *); -void irda_start_timer(struct timer_list *ptimer, int timeout, void* data, - TIMER_CALLBACK callback); +static inline void irda_start_timer(struct timer_list *ptimer, int timeout, + void* data, TIMER_CALLBACK callback) +{ + ptimer->function = (void (*)(unsigned long)) callback; + ptimer->data = (unsigned long) data; + + /* Set new value for timer (update or add timer). + * We use mod_timer() because it's more efficient and also + * safer with respect to race conditions - Jean II */ + mod_timer(ptimer, jiffies + timeout); +} + void irlap_start_slot_timer(struct irlap_cb *self, int timeout); void irlap_start_query_timer(struct irlap_cb *self, int timeout); diff -u -p -r linux/net/irda.s8/irsyms.c linux/net/irda/irsyms.c --- linux/net/irda.s8/irsyms.c Mon Mar 8 19:10:29 2004 +++ linux/net/irda/irsyms.c Mon Mar 8 19:15:41 2004 @@ -97,7 +97,6 @@ EXPORT_SYMBOL(irda_task_execute); EXPORT_SYMBOL(irda_task_next_state); EXPORT_SYMBOL(irda_task_delete); -EXPORT_SYMBOL(irda_start_timer); #ifdef CONFIG_IRDA_DEBUG __u32 irda_debug = IRDA_DEBUG_LEVEL; diff -u -p -r linux/net/irda.s8/timer.c linux/net/irda/timer.c --- linux/net/irda.s8/timer.c Wed Dec 17 18:58:56 2003 +++ linux/net/irda/timer.c Mon Mar 8 19:15:41 2004 @@ -41,29 +41,6 @@ static void irlap_wd_timer_expired(void* static void irlap_backoff_timer_expired(void* data); static void irlap_media_busy_expired(void* data); -/* - * Function irda_start_timer (timer, timeout) - * - * Start an IrDA timer - * - */ -void irda_start_timer(struct timer_list *ptimer, int timeout, void *data, - TIMER_CALLBACK callback) -{ - /* - * For most architectures void * is the same as unsigned long, but - * at least we try to use void * as long as possible. Since the - * timer functions use unsigned long, we cast the function here - */ - ptimer->function = (void (*)(unsigned long)) callback; - ptimer->data = (unsigned long) data; - - /* Set new value for timer (update or add timer). - * We use mod_timer() because it's more efficient and also - * safer with respect to race conditions - Jean II */ - mod_timer(ptimer, jiffies + timeout); -} - void irlap_start_slot_timer(struct irlap_cb *self, int timeout) { irda_start_timer(&self->slot_timer, timeout, (void *) self, - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |