Subject: [PATCH] e1000e: get rid of wasted space

From: Stephen Hemminger <[email-masked]>
Date: Mon, 20 Oct 2008 19:11:49 -0700

The name in the ring is only used once during setup so it shouldn't
be in the data structure.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/drivers/net/e1000e/e1000.h	2008-10-20 18:13:53.000000000 -0700
+++ b/drivers/net/e1000e/e1000.h	2008-10-20 18:18:30.000000000 -0700
@@ -153,7 +153,6 @@ struct e1000_ring {
 	/* array of buffer information structs */
 	struct e1000_buffer *buffer_info;
 
-	char name[IFNAMSIZ + 5];
 	u32 ims_val;
 	u32 itr_val;
 	u16 itr_register;
--- a/drivers/net/e1000e/netdev.c	2008-10-20 18:19:22.000000000 -0700
+++ b/drivers/net/e1000e/netdev.c	2008-10-20 18:21:00.000000000 -0700
@@ -1473,27 +1473,20 @@ static int e1000_request_msix(struct e10
 {
 	struct net_device *netdev = adapter->netdev;
 	int err = 0, vector = 0;
+	char irqname[IFNAMSIZ+5];
 
-	if (strlen(netdev->name) < (IFNAMSIZ - 5))
-		sprintf(adapter->rx_ring->name, "%s-rx0", netdev->name);
-	else
-		memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ);
+	snprintf(irqname, sizeof(irqname), "%s-rx0", netdev->name);
 	err = request_irq(adapter->msix_entries[vector].vector,
-			  &e1000_intr_msix_rx, 0, adapter->rx_ring->name,
-			  netdev);
+			  &e1000_intr_msix_rx, 0, irqname, netdev);
 	if (err)
 		goto out;
 	adapter->rx_ring->itr_register = E1000_EITR_82574(vector);
 	adapter->rx_ring->itr_val = adapter->itr;
 	vector++;
 
-	if (strlen(netdev->name) < (IFNAMSIZ - 5))
-		sprintf(adapter->tx_ring->name, "%s-tx0", netdev->name);
-	else
-		memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ);
+	snprintf(irqname, sizeof(irqname), "%s-tx0", netdev->name);
 	err = request_irq(adapter->msix_entries[vector].vector,
-			  &e1000_intr_msix_tx, 0, adapter->tx_ring->name,
-			  netdev);
+			  &e1000_intr_msix_tx, 0, irqname, netdev);
 	if (err)
 		goto out;
 	adapter->tx_ring->itr_register = E1000_EITR_82574(vector);