Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3ffe0ca authored by Tobias Klauser's avatar Tobias Klauser Committed by David S. Miller
Browse files

net: eth: altera: Remove sgdmadesclen member from altera_tse_private



altera_tse_private->sgdmadesclen is always assigned assigned the same
value and never changes during runtime.  Remove the struct member and
use a new define for sizeof(struct sgdma_descrip) instead.

Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent adc6310c
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -71,8 +71,6 @@ int sgdma_initialize(struct altera_tse_private *priv)
		      SGDMA_CTRLREG_INTEN |
		      SGDMA_CTRLREG_INTEN |
		      SGDMA_CTRLREG_ILASTD;
		      SGDMA_CTRLREG_ILASTD;


	priv->sgdmadesclen = sizeof(struct sgdma_descrip);

	INIT_LIST_HEAD(&priv->txlisthd);
	INIT_LIST_HEAD(&priv->txlisthd);
	INIT_LIST_HEAD(&priv->rxlisthd);
	INIT_LIST_HEAD(&priv->rxlisthd);


@@ -254,7 +252,7 @@ u32 sgdma_rx_status(struct altera_tse_private *priv)
		unsigned int pktstatus = 0;
		unsigned int pktstatus = 0;
		dma_sync_single_for_cpu(priv->device,
		dma_sync_single_for_cpu(priv->device,
					priv->rxdescphys,
					priv->rxdescphys,
					priv->sgdmadesclen,
					SGDMA_DESC_LEN,
					DMA_FROM_DEVICE);
					DMA_FROM_DEVICE);


		pktlength = csrrd16(desc, sgdma_descroffs(bytes_xferred));
		pktlength = csrrd16(desc, sgdma_descroffs(bytes_xferred));
@@ -374,7 +372,7 @@ static int sgdma_async_read(struct altera_tse_private *priv)


		dma_sync_single_for_device(priv->device,
		dma_sync_single_for_device(priv->device,
					   priv->rxdescphys,
					   priv->rxdescphys,
					   priv->sgdmadesclen,
					   SGDMA_DESC_LEN,
					   DMA_TO_DEVICE);
					   DMA_TO_DEVICE);


		csrwr32(lower_32_bits(sgdma_rxphysaddr(priv, cdesc)),
		csrwr32(lower_32_bits(sgdma_rxphysaddr(priv, cdesc)),
@@ -402,7 +400,7 @@ static int sgdma_async_write(struct altera_tse_private *priv,
	csrwr32(0x1f, priv->tx_dma_csr, sgdma_csroffs(status));
	csrwr32(0x1f, priv->tx_dma_csr, sgdma_csroffs(status));


	dma_sync_single_for_device(priv->device, priv->txdescphys,
	dma_sync_single_for_device(priv->device, priv->txdescphys,
				   priv->sgdmadesclen, DMA_TO_DEVICE);
				   SGDMA_DESC_LEN, DMA_TO_DEVICE);


	csrwr32(lower_32_bits(sgdma_txphysaddr(priv, desc)),
	csrwr32(lower_32_bits(sgdma_txphysaddr(priv, desc)),
		priv->tx_dma_csr,
		priv->tx_dma_csr,
+1 −0
Original line number Original line Diff line number Diff line
@@ -50,6 +50,7 @@ struct sgdma_descrip {
	u8	control;
	u8	control;
} __packed;
} __packed;


#define SGDMA_DESC_LEN	sizeof(struct sgdma_descrip)


#define SGDMA_STATUS_ERR		BIT(0)
#define SGDMA_STATUS_ERR		BIT(0)
#define SGDMA_STATUS_LENGTH_ERR		BIT(1)
#define SGDMA_STATUS_LENGTH_ERR		BIT(1)
+0 −1
Original line number Original line Diff line number Diff line
@@ -458,7 +458,6 @@ struct altera_tse_private {
	u32 rxctrlreg;
	u32 rxctrlreg;
	dma_addr_t rxdescphys;
	dma_addr_t rxdescphys;
	dma_addr_t txdescphys;
	dma_addr_t txdescphys;
	size_t sgdmadesclen;


	struct list_head txlisthd;
	struct list_head txlisthd;
	struct list_head rxlisthd;
	struct list_head rxlisthd;