patch-2.3.99-pre7 linux/drivers/net/net_init.c

Next file: linux/drivers/net/ni5010.c
Previous file: linux/drivers/net/ne3210.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -74,7 +74,7 @@
 	int alloc_size;
 
 	/* ensure 32-byte alignment of the private area */
-	alloc_size = sizeof (*dev) + IFNAMSIZ + sizeof_priv + 31;
+	alloc_size = sizeof (*dev) + sizeof_priv + 31;
 
 	dev = (struct net_device *) kmalloc (alloc_size, GFP_KERNEL);
 	if (dev == NULL)
@@ -88,7 +88,6 @@
 	if (sizeof_priv)
 		dev->priv = (void *) (((long)(dev + 1) + 31) & ~31);
 
-	dev->name = sizeof_priv + 31 + (char *)(dev + 1);
 	return dev;
 }
 
@@ -116,7 +115,7 @@
 	 *	Allocate a name
 	 */
 	 
-	if (dev->name && (dev->name[0] == '\0' || dev->name[0] == ' '))
+	if (dev->name[0] == '\0' || dev->name[0] == ' ')
 	{
 		if(dev_alloc_name(dev, mask)<0)
 		{
@@ -155,8 +154,7 @@
  * alignment is enforced for this private data area.
  *
  * If an empty string area is passed as dev->name, or a new structure is made,
- * a new name string is constructed.  The passed string area should be 8 bytes
- * long.
+ * a new name string is constructed.
  */
 
 struct net_device *init_etherdev(struct net_device *dev, int sizeof_priv)
@@ -413,7 +411,7 @@
 	 *	do a name allocation
 	 */
 	 
-	if (dev->name && strchr(dev->name, '%'))
+	if (strchr(dev->name, '%'))
 	{
 		err = -EBUSY;
 		if(dev_alloc_name(dev, dev->name)<0)
@@ -424,7 +422,7 @@
 	 *	Back compatibility hook. Kill this one in 2.5
 	 */
 	
-	if (dev->name && (dev->name[0]==0 || dev->name[0]==' '))
+	if (dev->name[0]==0 || dev->name[0]==' ')
 	{
 		err = -EBUSY;
 		if(dev_alloc_name(dev, "eth%d")<0)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)