[PATCH net-next 0/2] net: r6040: Non-functional changes

STALE1914d

4 messages, 2 authors, 2021-05-24 · open the first message on its own page

[PATCH net-next 0/2] net: r6040: Non-functional changes

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-05-23 15:54:27

Hi David, Jakub,

These two patches clean up the r6040 driver a little bit in preparation
for adding additional features such as dumping MAC counters and properly
dealing with DMA-API mapping.

Thanks

Florian Fainelli (2):
  net: r6040: Use logical or for MDIO operations
  net: r6040: Use ETH_FCS_LEN

 drivers/net/ethernet/rdc/r6040.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.25.1

[PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-05-23 15:54:34

This is not a functional change, but we should be using a logical or to
assign the bits we will be writing to the MDIO read and write registers.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/rdc/r6040.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 7c74318620b1..aff68e2cb700 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -200,7 +200,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)
 	int limit = MAC_DEF_TIMEOUT;
 	u16 cmd;
 
-	iowrite16(MDIO_READ + reg + (phy_addr << 8), ioaddr + MMDIO);
+	iowrite16(MDIO_READ | reg | (phy_addr << 8), ioaddr + MMDIO);
 	/* Wait for the read bit to be cleared */
 	while (limit--) {
 		cmd = ioread16(ioaddr + MMDIO);
@@ -224,7 +224,7 @@ static int r6040_phy_write(void __iomem *ioaddr,
 
 	iowrite16(val, ioaddr + MMWD);
 	/* Write the command to the MDIO bus */
-	iowrite16(MDIO_WRITE + reg + (phy_addr << 8), ioaddr + MMDIO);
+	iowrite16(MDIO_WRITE | reg | (phy_addr << 8), ioaddr + MMDIO);
 	/* Wait for the write bit to be cleared */
 	while (limit--) {
 		cmd = ioread16(ioaddr + MMDIO);
-- 
2.25.1

[PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-05-23 15:54:34

Instead of the open coded constant 4.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/rdc/r6040.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index aff68e2cb700..ef78c2424668 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -544,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit)
 		skb_ptr->dev = priv->dev;
 
 		/* Do not count the CRC */
-		skb_put(skb_ptr, descptr->len - 4);
+		skb_put(skb_ptr, descptr->len - ETH_FCS_LEN);
 		dma_unmap_single(&priv->pdev->dev, le32_to_cpu(descptr->buf),
 				 MAX_BUF_SIZE, DMA_FROM_DEVICE);
 		skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev);
@@ -552,7 +552,7 @@ static int r6040_rx(struct net_device *dev, int limit)
 		/* Send to upper layer */
 		netif_receive_skb(skb_ptr);
 		dev->stats.rx_packets++;
-		dev->stats.rx_bytes += descptr->len - 4;
+		dev->stats.rx_bytes += descptr->len - ETH_FCS_LEN;
 
 		/* put new skb into descriptor */
 		descptr->skb_ptr = new_skb;
-- 
2.25.1

Re: [PATCH net-next 0/2] net: r6040: Non-functional changes

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-05-24 00:30:24

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Sun, 23 May 2021 08:54:09 -0700 you wrote:
Hi David, Jakub,

These two patches clean up the r6040 driver a little bit in preparation
for adding additional features such as dumping MAC counters and properly
dealing with DMA-API mapping.

Thanks

[...]
Here is the summary with links:
  - [net-next,1/2] net: r6040: Use logical or for MDIO operations
    https://git.kernel.org/netdev/net-next/c/190e6e291a4c
  - [net-next,2/2] net: r6040: Use ETH_FCS_LEN
    https://git.kernel.org/netdev/net-next/c/06666907a38a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help