linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: r6040: Non-functional changes
@ 2021-05-23 15:54 Florian Fainelli
  2021-05-23 15:54 ` [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-05-23 15:54 UTC (permalink / raw)
  To: netdev; +Cc: Florian Fainelli, David S. Miller, Jakub Kicinski, open list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations
  2021-05-23 15:54 [PATCH net-next 0/2] net: r6040: Non-functional changes Florian Fainelli
@ 2021-05-23 15:54 ` Florian Fainelli
  2021-05-23 15:54 ` [PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN Florian Fainelli
  2021-05-24  0:30 ` [PATCH net-next 0/2] net: r6040: Non-functional changes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-05-23 15:54 UTC (permalink / raw)
  To: netdev; +Cc: Florian Fainelli, David S. Miller, Jakub Kicinski, open list

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN
  2021-05-23 15:54 [PATCH net-next 0/2] net: r6040: Non-functional changes Florian Fainelli
  2021-05-23 15:54 ` [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations Florian Fainelli
@ 2021-05-23 15:54 ` Florian Fainelli
  2021-05-24  0:30 ` [PATCH net-next 0/2] net: r6040: Non-functional changes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-05-23 15:54 UTC (permalink / raw)
  To: netdev; +Cc: Florian Fainelli, David S. Miller, Jakub Kicinski, open list

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] net: r6040: Non-functional changes
  2021-05-23 15:54 [PATCH net-next 0/2] net: r6040: Non-functional changes Florian Fainelli
  2021-05-23 15:54 ` [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations Florian Fainelli
  2021-05-23 15:54 ` [PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN Florian Fainelli
@ 2021-05-24  0:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-24  0:30 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, davem, kuba, linux-kernel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-24  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 15:54 [PATCH net-next 0/2] net: r6040: Non-functional changes Florian Fainelli
2021-05-23 15:54 ` [PATCH net-next 1/2] net: r6040: Use logical or for MDIO operations Florian Fainelli
2021-05-23 15:54 ` [PATCH net-next 2/2] net: r6040: Use ETH_FCS_LEN Florian Fainelli
2021-05-24  0:30 ` [PATCH net-next 0/2] net: r6040: Non-functional changes patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).