Skip to contentSkip to conversation

sfc: remove unneeded variable

PATCH Superseded Dan Carpenter 4 participants 7 messages Nov 24, 2016 – Nov 28, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sfc: remove unneeded variable

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

drivers/net/ethernet/sfc/net_driver.h +1 -6
index f97f828..fd17bda 100644
@@ -139,8 +139,6 @@ struct efx_special_buffer {
  * struct efx_tx_buffer - buffer state for a TX descriptor
  * @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
  *	freed when descriptor completes
- * @heap_buf: When @flags & %EFX_TX_BUF_HEAP, the associated heap buffer to be
- *	freed when descriptor completes.
  * @option: When @flags & %EFX_TX_BUF_OPTION, a NIC-specific option descriptor.
  * @dma_addr: DMA address of the fragment.
  * @flags: Flags for allocation and DMA mapping type
@@ -151,10 +149,7 @@ struct efx_special_buffer {
  * Only valid if @unmap_len != 0.
  */
 struct efx_tx_buffer {
-	union {
-		const struct sk_buff *skb;
-		void *heap_buf;
-	};
+	const struct sk_buff *skb;
 	union {
 		efx_qword_t option;
 		dma_addr_t dma_addr;
drivers/net/ethernet/sfc/tx.c +0 -2
index 1aa728c..bb07034 100644
@@ -84,8 +84,6 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
 		netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
 			   "TX queue %d transmission id %x complete\n",
 			   tx_queue->queue, tx_queue->read_count);
-	} else if (buffer->flags & EFX_TX_BUF_HEAP) {
-		kfree(buffer->heap_buf);
 	}
 
 	buffer->len = 0;
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.

#2 lore raw
In reply to Dan Carpenter
Quoted 10 lines · Dan Carpenter

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

drivers/net/ethernet/sfc/net_driver.h +0 -0
index f97f828..fd17bda 100644

drivers/net/ethernet/sfc/net_driver.h struct efx_special_buffer { · line 143

Quoted 5 lines
drivers/net/ethernet/sfc/net_driver.h +0 -2
@@ -139,8 +139,6 @@ struct efx_special_buffer {
  * struct efx_tx_buffer - buffer state for a TX descriptor
  * @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
  *   freed when descriptor completes
- * @heap_buf: When @flags & %EFX_TX_BUF_HEAP, the associated heap buffer to be
- *   freed when descriptor completes.

Does that mean we can also remove EFX_TX_BUF_HEAP? -Ed

The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.

#3 lore raw
Quoted 6 lines · Edward Cree
Quoted 5 lines · Dan Carpenter

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

Quoted 12 lines

drivers/net/ethernet/sfc/net_driver.h struct efx_special_buffer { · line 143

Quoted 10 lines
drivers/net/ethernet/sfc/net_driver.h +0 -2
index f97f828..fd17bda 100644
@@ -139,8 +139,6 @@ struct efx_special_buffer {
  * struct efx_tx_buffer - buffer state for a TX descriptor
  * @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
  *   freed when descriptor completes
- * @heap_buf: When @flags & %EFX_TX_BUF_HEAP, the associated heap buffer to be
- *   freed when descriptor completes.

Does that mean we can also remove EFX_TX_BUF_HEAP?

Good point. I will resend.

regards,
dan carpenter

#4 lore raw

PATCH v2 1/1 sfc: remove unneeded variable

In reply to Edward Cree

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

drivers/net/ethernet/sfc/net_driver.h +1 -7
index f97f828..18aceb2 100644
@@ -139,8 +139,6 @@ struct efx_special_buffer {
  * struct efx_tx_buffer - buffer state for a TX descriptor
  * @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
  *	freed when descriptor completes
- * @heap_buf: When @flags & %EFX_TX_BUF_HEAP, the associated heap buffer to be
- *	freed when descriptor completes.
  * @option: When @flags & %EFX_TX_BUF_OPTION, a NIC-specific option descriptor.
  * @dma_addr: DMA address of the fragment.
  * @flags: Flags for allocation and DMA mapping type
@@ -151,10 +149,7 @@ struct efx_special_buffer {
  * Only valid if @unmap_len != 0.
  */
 struct efx_tx_buffer {
-	union {
-		const struct sk_buff *skb;
-		void *heap_buf;
-	};
+	const struct sk_buff *skb;
 	union {
 		efx_qword_t option;
 		dma_addr_t dma_addr;
@@ -166,7 +161,6 @@ struct efx_tx_buffer {
 };
 #define EFX_TX_BUF_CONT		1	/* not last descriptor of packet */
 #define EFX_TX_BUF_SKB		2	/* buffer is last part of skb */
-#define EFX_TX_BUF_HEAP		4	/* buffer was allocated with kmalloc() */
 #define EFX_TX_BUF_MAP_SINGLE	8	/* buffer was mapped with dma_map_single() */
 #define EFX_TX_BUF_OPTION	0x10	/* empty buffer for option descriptor */
 
drivers/net/ethernet/sfc/tx.c +0 -2
index 1aa728c..bb07034 100644
@@ -84,8 +84,6 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
 		netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
 			   "TX queue %d transmission id %x complete\n",
 			   tx_queue->queue, tx_queue->read_count);
-	} else if (buffer->flags & EFX_TX_BUF_HEAP) {
-		kfree(buffer->heap_buf);
 	}
 
 	buffer->len = 0;
Acked-by on v2 1/1
#5 lore raw
Quoted 4 lines · Dan Carpenter

We don't use ->heap_buf after commit 46d1efd852cc ("sfc: remove Software TSO") so let's remove the last traces.

Quoted 38 lines
drivers/net/ethernet/sfc/net_driver.h +1 -7
index f97f828..18aceb2 100644
@@ -139,8 +139,6 @@ struct efx_special_buffer {
  * struct efx_tx_buffer - buffer state for a TX descriptor
  * @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
  *   freed when descriptor completes
- * @heap_buf: When @flags & %EFX_TX_BUF_HEAP, the associated heap buffer to be
- *   freed when descriptor completes.
  * @option: When @flags & %EFX_TX_BUF_OPTION, a NIC-specific option descriptor.
  * @dma_addr: DMA address of the fragment.
  * @flags: Flags for allocation and DMA mapping type
@@ -151,10 +149,7 @@ struct efx_special_buffer {
  * Only valid if @unmap_len != 0.
  */
 struct efx_tx_buffer {
-     union {
-             const struct sk_buff *skb;
-             void *heap_buf;
-     };
+     const struct sk_buff *skb;
      union {
              efx_qword_t option;
              dma_addr_t dma_addr;
@@ -166,7 +161,6 @@ struct efx_tx_buffer {
 };
 #define EFX_TX_BUF_CONT              1       /* not last descriptor of packet */
 #define EFX_TX_BUF_SKB               2       /* buffer is last part of skb */
-#define EFX_TX_BUF_HEAP              4       /* buffer was allocated with kmalloc() */
 #define EFX_TX_BUF_MAP_SINGLE        8       /* buffer was mapped with dma_map_single() */
 #define EFX_TX_BUF_OPTION    0x10    /* empty buffer for option descriptor */
 
drivers/net/ethernet/sfc/tx.c +0 -0
index 1aa728c..bb07034 100644

drivers/net/ethernet/sfc/tx.c static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue, · line 89

Quoted 8 lines
drivers/net/ethernet/sfc/tx.c +0 -2
@@ -84,8 +84,6 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
              netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
                         "TX queue %d transmission id %x complete\n",
                         tx_queue->queue, tx_queue->read_count);
-     } else if (buffer->flags & EFX_TX_BUF_HEAP) {
-             kfree(buffer->heap_buf);
      }
 
      buffer->len = 0;

The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.