mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6 IrDA] txqueue_empty
@ 2004-02-26  3:21 Jean Tourrilhes
  0 siblings, 0 replies; only message in thread
From: Jean Tourrilhes @ 2004-02-26  3:21 UTC (permalink / raw)
  To: David S. Miller, Linux kernel mailing list

irXXX_txqueue_empty.diff :
~~~~~~~~~~~~~~~~~~~~~~~~
		<Patch from Stephen Hemminger>
	o [FEATURE] optimise irda_device_txqueue_empty by making inline


diff -Nru a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
--- a/include/net/irda/irda_device.h	Mon Feb 23 11:00:44 2004
+++ b/include/net/irda/irda_device.h	Mon Feb 23 11:00:44 2004
@@ -45,6 +45,7 @@
 #include <linux/skbuff.h>		/* struct sk_buff */
 #include <linux/irda.h>
 
+#include <net/pkt_sched.h>
 #include <net/irda/irda.h>
 #include <net/irda/qos.h>		/* struct qos_info */
 #include <net/irda/irqueue.h>		/* irda_queue_t */
@@ -219,7 +220,10 @@
 int  irda_device_is_receiving(struct net_device *dev);
 
 /* Interface for internal use */
-int  irda_device_txqueue_empty(struct net_device *dev);
+static inline int irda_device_txqueue_empty(const struct net_device *dev)
+{
+	return (skb_queue_len(&dev->qdisc->q) == 0);
+}
 int  irda_device_set_raw_mode(struct net_device* self, int status);
 int  irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts);
 int  irda_device_change_speed(struct net_device *dev, __u32 speed);
diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c
--- a/net/irda/irda_device.c	Mon Feb 23 11:00:44 2004
+++ b/net/irda/irda_device.c	Mon Feb 23 11:00:44 2004
@@ -47,8 +47,6 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 
-#include <net/pkt_sched.h>
-
 #include <net/irda/irda_device.h>
 #include <net/irda/irlap.h>
 #include <net/irda/timer.h>
@@ -403,22 +401,6 @@
 struct net_device *alloc_irdadev(int sizeof_priv)
 {
 	return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup);
-}
-
-
-/*
- * Function irda_device_txqueue_empty (dev)
- *
- *    Check if there is still some frames in the transmit queue for this
- *    device. Maybe we should use: q->q.qlen == 0.
- *
- */
-int irda_device_txqueue_empty(struct net_device *dev)
-{
-	if (skb_queue_len(&dev->qdisc->q))
-		return FALSE;
-
-	return TRUE;
 }
 
 /*

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

only message in thread, other threads:[~2004-02-26  3:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-26  3:21 [PATCH 2.6 IrDA] txqueue_empty Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®