From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 08/10] staging: rtl8192e: Convert array rx_ring_dma[] to variable rx_ring_dma
Date: Thu, 26 Oct 2023 07:44:18 +0200 [thread overview]
Message-ID: <51d3be0a715452cefe5ac6dd29a86fbe65b824fa.1698295861.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1698295861.git.philipp.g.hortmann@gmail.com>
Convert array rx_ring_dma[] to variable rx_ring_dma as index is always 0.
This increases readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++--
drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index e343e10e011a..e93394c51264 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1841,7 +1841,7 @@ void rtl92e_enable_rx(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
- rtl92e_writel(dev, RDQDA, priv->rx_ring_dma[RX_MPDU_QUEUE]);
+ rtl92e_writel(dev, RDQDA, priv->rx_ring_dma);
}
static const u32 TX_DESC_BASE[] = {
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 573d548e44d8..8af732870ddf 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1159,7 +1159,7 @@ static void _rtl92e_free_rx_ring(struct net_device *dev)
dma_free_coherent(&priv->pdev->dev,
sizeof(*priv->rx_ring) * priv->rxringcount,
priv->rx_ring,
- priv->rx_ring_dma[rx_queue_idx]);
+ priv->rx_ring_dma);
priv->rx_ring = NULL;
}
@@ -1356,7 +1356,7 @@ static short _rtl92e_alloc_rx_ring(struct net_device *dev)
priv->rx_ring = dma_alloc_coherent(&priv->pdev->dev,
sizeof(*priv->rx_ring) * priv->rxringcount,
- &priv->rx_ring_dma[rx_queue_idx],
+ &priv->rx_ring_dma,
GFP_ATOMIC);
if (!priv->rx_ring || (unsigned long)priv->rx_ring & 0xFF) {
netdev_warn(dev, "Cannot allocate RX ring\n");
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 2a99873fbe90..b3ebff2df62a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -234,7 +234,7 @@ struct r8192_priv {
struct rx_desc *rx_ring;
struct sk_buff *rx_buf[MAX_RX_COUNT];
- dma_addr_t rx_ring_dma[MAX_RX_QUEUE];
+ dma_addr_t rx_ring_dma;
unsigned int rx_idx[MAX_RX_QUEUE];
int rxringcount;
u16 rxbuffersize;
--
2.42.0
next prev parent reply other threads:[~2023-10-26 5:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 5:43 [PATCH 00/10] staging: rtl8192e: Convert array rx_ring[] to rx_ring Philipp Hortmann
2023-10-26 5:43 ` [PATCH 01/10] staging: rtl8192e: Remove HTIOTActIsDisableMCS14() Philipp Hortmann
2023-10-26 5:43 ` [PATCH 02/10] staging: rtl8192e: Remove HTIOTActIsDisableMCS15() Philipp Hortmann
2023-10-26 5:43 ` [PATCH 03/10] staging: rtl8192e: Remove HTIOTActIsDisableMCSTwoSpatialStream() Philipp Hortmann
2023-10-26 5:43 ` [PATCH 04/10] staging: rtl8192e: Remove HTIOTActIsDisableEDCATurbo() Philipp Hortmann
2023-10-26 5:43 ` [PATCH 05/10] staging: rtl8192e: Remove loops with constant MAX_RX_QUEUE Philipp Hortmann
2023-10-26 5:44 ` [PATCH 06/10] staging: rtl8192e: Convert array rx_ring[] to variable rx_ring Philipp Hortmann
2023-10-26 5:44 ` [PATCH 07/10] staging: rtl8192e: Convert array rx_buf[][] to array rx_buf[] Philipp Hortmann
2023-10-26 5:44 ` Philipp Hortmann [this message]
2023-10-26 5:44 ` [PATCH 09/10] staging: rtl8192e: Convert array rx_idx[] to variable rx_idx Philipp Hortmann
2023-10-26 7:09 ` Dan Carpenter
2023-10-26 5:44 ` [PATCH 10/10] staging: rtl8192e: Remove unused constants starting with MAX_RX_QUEUE Philipp Hortmann
2023-10-26 7:09 ` [PATCH 00/10] staging: rtl8192e: Convert array rx_ring[] to rx_ring Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51d3be0a715452cefe5ac6dd29a86fbe65b824fa.1698295861.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®