linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6 IrDA] (9/14) irda_start_timer inline
@ 2004-03-09 19:08 Jean Tourrilhes
  0 siblings, 0 replies; only message in thread
From: Jean Tourrilhes @ 2004-03-09 19:08 UTC (permalink / raw)
  To: David S. Miller, Linux kernel mailing list

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, 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-09 19:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-09 19:08 [PATCH 2.6 IrDA] (9/14) irda_start_timer inline Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).