netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] (1/5) get rid of useless hashbin in irtty
@ 2003-08-15 22:46 Stephen Hemminger
  2003-08-15 23:05 ` Jean Tourrilhes
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Hemminger @ 2003-08-15 22:46 UTC (permalink / raw)
  To: Jean Tourrilhes; +Cc: irda-users, netdev

Working on converting IRDA to new netdevice semantics, this is the first
of some of the small things I found.

The irtty hashbin is created, maintained and never used.
Motivation for removing is that the hashbin locking has problems with
the locking assumptions in on network device removal.


diff -Nru a/drivers/net/irda/irtty.c b/drivers/net/irda/irtty.c
--- a/drivers/net/irda/irtty.c	Fri Aug 15 11:46:11 2003
+++ b/drivers/net/irda/irtty.c	Fri Aug 15 11:46:11 2003
@@ -39,7 +39,6 @@
 #include <net/irda/wrapper.h>
 #include <net/irda/irda_device.h>
 
-static hashbin_t *irtty = NULL;
 static struct tty_ldisc irda_ldisc;
 
 static int qos_mtt_bits = 0x03;      /* 5 ms or more */
@@ -75,14 +74,6 @@
 {
 	int status;
 
-	/* Probably no need to lock here because all operations done in
-	 * open()/close() which are already safe - Jean II */
-	irtty = hashbin_new( HB_NOLOCK);
-	if ( irtty == NULL) {
-		printk( KERN_WARNING "IrDA: Can't allocate irtty hashbin!\n");
-		return -ENOMEM;
-	}
-
 	/* Fill in our line protocol discipline, and register it */
 	memset(&irda_ldisc, 0, sizeof( irda_ldisc));
 
@@ -124,12 +115,6 @@
 		      __FUNCTION__, ret);
 	}
 
-	/*
-	 *  The TTY should care of deallocating the instances by using the
-	 *  callback to irtty_close(), therefore we do give any deallocation
-	 *  function to hashbin_destroy().
-	 */
-	hashbin_delete(irtty, NULL);
 }
 
 /* 
@@ -172,8 +157,6 @@
 	/* Give self a name */
 	strcpy(name, tty->name);
 
-	hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL);
-
 	if (tty->driver->flush_buffer)
 		tty->driver->flush_buffer(tty);
 	
@@ -285,8 +268,6 @@
 	if (self->netdev)
 		unregister_netdev(self->netdev);
 	
-	self = hashbin_remove(irtty, (int) self, NULL);
-
 	/* Protect access to self->task and self->?x_buff - Jean II */
 	spin_lock_irqsave(&self->lock, flags);
 
diff -Nru a/include/net/irda/irtty.h b/include/net/irda/irtty.h
--- a/include/net/irda/irtty.h	Fri Aug 15 11:46:11 2003
+++ b/include/net/irda/irtty.h	Fri Aug 15 11:46:11 2003
@@ -31,7 +31,6 @@
 #include <linux/netdevice.h>
 
 #include <net/irda/irda.h>
-#include <net/irda/irqueue.h>
 #include <net/irda/irda_device.h>
 
 /* Used by ioctl */
@@ -45,7 +44,6 @@
 #define IRTTY_IOC_MAXNR   2
 
 struct irtty_cb {
-	irda_queue_t q;     /* Must be first */
 	magic_t magic;
 
 	struct net_device *netdev; /* Yes! we are some kind of netdevice */

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2003-08-20  4:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-15 22:46 [PATCH] (1/5) get rid of useless hashbin in irtty Stephen Hemminger
2003-08-15 23:05 ` Jean Tourrilhes
2003-08-16 12:20   ` David S. Miller
2003-08-17  0:14     ` Jean Tourrilhes
2003-08-17  0:58       ` David S. Miller
2003-08-17  1:11         ` Jean Tourrilhes
2003-08-17  1:09           ` David S. Miller
2003-08-17  1:36             ` Jean Tourrilhes
2003-08-18 16:03           ` Stephen Hemminger
2003-08-18 16:50             ` Jean Tourrilhes
2003-08-18 16:53               ` Jeff Garzik
2003-08-18 17:08                 ` Jean Tourrilhes
2003-08-19  0:07                   ` Jeff Garzik
2003-08-19 22:58                     ` [PATCH] kill old irtty Stephen Hemminger
2003-08-20  4:02                       ` David S. Miller
     [not found]         ` <Pine.LNX.4.44.0308171335050.1409-100000@notebook.home.mdiehl.de>
2003-08-18  5:18           ` [PATCH] (1/5) get rid of useless hashbin in irtty David S. Miller
     [not found]             ` <Pine.LNX.4.44.0308180959150.3006-100000@notebook.home.mdiehl.de>
2003-08-18  9:21               ` David S. Miller

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).