[PATCH 07/10] staging: rtl8192e: Convert array rx_buf[][] to array rx_buf[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert array rx_buf[][] to array rx_buf[] as index is always 0. This
increases readability.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 8 ++++----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index d0d5b1dfff48..573d548e44d8 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1145,7 +1145,7 @@ static void _rtl92e_free_rx_ring(struct net_device *dev)
 	int rx_queue_idx = 0;
 
 	for (i = 0; i < priv->rxringcount; i++) {
-		struct sk_buff *skb = priv->rx_buf[rx_queue_idx][i];
+		struct sk_buff *skb = priv->rx_buf[i];
 
 		if (!skb)
 			continue;
@@ -1373,7 +1373,7 @@ static short _rtl92e_alloc_rx_ring(struct net_device *dev)
 		if (!skb)
 			return 0;
 		skb->dev = dev;
-		priv->rx_buf[rx_queue_idx][i] = skb;
+		priv->rx_buf[i] = skb;
 		mapping = (dma_addr_t *)skb->cb;
 		*mapping = dma_map_single(&priv->pdev->dev,
 					  skb_tail_pointer(skb),
@@ -1575,7 +1575,7 @@ static void _rtl92e_rx_normal(struct net_device *dev)
 	while (count--) {
 		struct rx_desc *pdesc = &priv->rx_ring
 					[priv->rx_idx[rx_queue_idx]];
-		struct sk_buff *skb = priv->rx_buf[rx_queue_idx]
+		struct sk_buff *skb = priv->rx_buf
 				      [priv->rx_idx[rx_queue_idx]];
 		struct sk_buff *new_skb;
 
@@ -1614,7 +1614,7 @@ static void _rtl92e_rx_normal(struct net_device *dev)
 		skb = new_skb;
 		skb->dev = dev;
 
-		priv->rx_buf[rx_queue_idx][priv->rx_idx[rx_queue_idx]] =
+		priv->rx_buf[priv->rx_idx[rx_queue_idx]] =
 								 skb;
 		*((dma_addr_t *)skb->cb) = dma_map_single(&priv->pdev->dev,
 							  skb_tail_pointer(skb),
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index caa8a00cc922..2a99873fbe90 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -233,7 +233,7 @@ struct r8192_priv {
 	u8 (*rf_set_chan)(struct net_device *dev, u8 ch);
 
 	struct rx_desc *rx_ring;
-	struct sk_buff	*rx_buf[MAX_RX_QUEUE][MAX_RX_COUNT];
+	struct sk_buff	*rx_buf[MAX_RX_COUNT];
 	dma_addr_t	rx_ring_dma[MAX_RX_QUEUE];
 	unsigned int	rx_idx[MAX_RX_QUEUE];
 	int		rxringcount;
-- 
2.42.0





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux