Commit 0c3f3c4f authored by Andrew Halaney's avatar Andrew Halaney Committed by Paolo Abeni
Browse files

net: stmmac: Remove some unnecessary void pointers



There's a few spots in the hardware interface where a void pointer is
used, but what's passed in and later cast out is always the same type.

Just use the proper type directly.

Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarBrian Masney <bmasney@redhat.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d638dcb5
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -14,9 +14,9 @@

#include "stmmac.h"

static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
		     int csum)
{
	struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)p;
	unsigned int nopaged_len = skb_headlen(skb);
	struct stmmac_priv *priv = tx_q->priv_data;
	unsigned int entry = tx_q->cur_tx;
@@ -125,9 +125,8 @@ static void init_dma_chain(void *des, dma_addr_t phy_addr,
	}
}

static void refill_desc3(void *priv_ptr, struct dma_desc *p)
static void refill_desc3(struct stmmac_rx_queue *rx_q, struct dma_desc *p)
{
	struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)priv_ptr;
	struct stmmac_priv *priv = rx_q->priv_data;

	if (priv->hwts_rx_en && !priv->extend_desc)
@@ -141,9 +140,8 @@ static void refill_desc3(void *priv_ptr, struct dma_desc *p)
				      sizeof(struct dma_desc)));
}

static void clean_desc3(void *priv_ptr, struct dma_desc *p)
static void clean_desc3(struct stmmac_tx_queue *tx_q, struct dma_desc *p)
{
	struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)priv_ptr;
	struct stmmac_priv *priv = tx_q->priv_data;
	unsigned int entry = tx_q->dirty_tx;

+2 −2
Original line number Diff line number Diff line
@@ -80,10 +80,10 @@ static void dwmac100_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space)
}

/* DMA controller has two counters to track the number of the missed frames. */
static void dwmac100_dma_diagnostic_fr(void *data, struct stmmac_extra_stats *x,
static void dwmac100_dma_diagnostic_fr(struct net_device_stats *stats,
				       struct stmmac_extra_stats *x,
				       void __iomem *ioaddr)
{
	struct net_device_stats *stats = (struct net_device_stats *)data;
	u32 csr8 = readl(ioaddr + DMA_MISSED_FRAME_CTR);

	if (unlikely(csr8)) {
+4 −4
Original line number Diff line number Diff line
@@ -13,11 +13,11 @@
#include "dwmac4.h"
#include "dwmac4_descs.h"

static int dwmac4_wrback_get_tx_status(void *data, struct stmmac_extra_stats *x,
static int dwmac4_wrback_get_tx_status(struct net_device_stats *stats,
				       struct stmmac_extra_stats *x,
				       struct dma_desc *p,
				       void __iomem *ioaddr)
{
	struct net_device_stats *stats = (struct net_device_stats *)data;
	unsigned int tdes3;
	int ret = tx_done;

@@ -73,10 +73,10 @@ static int dwmac4_wrback_get_tx_status(void *data, struct stmmac_extra_stats *x,
	return ret;
}

static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x,
static int dwmac4_wrback_get_rx_status(struct net_device_stats *stats,
				       struct stmmac_extra_stats *x,
				       struct dma_desc *p)
{
	struct net_device_stats *stats = (struct net_device_stats *)data;
	unsigned int rdes1 = le32_to_cpu(p->des1);
	unsigned int rdes2 = le32_to_cpu(p->des2);
	unsigned int rdes3 = le32_to_cpu(p->des3);
+4 −2
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@
#include "common.h"
#include "dwxgmac2.h"

static int dwxgmac2_get_tx_status(void *data, struct stmmac_extra_stats *x,
static int dwxgmac2_get_tx_status(struct net_device_stats *stats,
				  struct stmmac_extra_stats *x,
				  struct dma_desc *p, void __iomem *ioaddr)
{
	unsigned int tdes3 = le32_to_cpu(p->des3);
@@ -22,7 +23,8 @@ static int dwxgmac2_get_tx_status(void *data, struct stmmac_extra_stats *x,
	return ret;
}

static int dwxgmac2_get_rx_status(void *data, struct stmmac_extra_stats *x,
static int dwxgmac2_get_rx_status(struct net_device_stats *stats,
				  struct stmmac_extra_stats *x,
				  struct dma_desc *p)
{
	unsigned int rdes3 = le32_to_cpu(p->des3);
+6 −5
Original line number Diff line number Diff line
@@ -12,10 +12,10 @@
#include "common.h"
#include "descs_com.h"

static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x,
static int enh_desc_get_tx_status(struct net_device_stats *stats,
				  struct stmmac_extra_stats *x,
				  struct dma_desc *p, void __iomem *ioaddr)
{
	struct net_device_stats *stats = (struct net_device_stats *)data;
	unsigned int tdes0 = le32_to_cpu(p->des0);
	int ret = tx_done;

@@ -117,7 +117,8 @@ static int enh_desc_coe_rdes0(int ipc_err, int type, int payload_err)
	return ret;
}

static void enh_desc_get_ext_status(void *data, struct stmmac_extra_stats *x,
static void enh_desc_get_ext_status(struct net_device_stats *stats,
				    struct stmmac_extra_stats *x,
				    struct dma_extended_desc *p)
{
	unsigned int rdes0 = le32_to_cpu(p->basic.des0);
@@ -181,10 +182,10 @@ static void enh_desc_get_ext_status(void *data, struct stmmac_extra_stats *x,
	}
}

static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
static int enh_desc_get_rx_status(struct net_device_stats *stats,
				  struct stmmac_extra_stats *x,
				  struct dma_desc *p)
{
	struct net_device_stats *stats = (struct net_device_stats *)data;
	unsigned int rdes0 = le32_to_cpu(p->des0);
	int ret = good_frame;

Loading