Skip to contentSkip to conversation

r8169,sis190: remove unnecessary length check

PATCH Applied Peter Wu 3 participants 3 messages Aug 17, 2013 – Aug 20, 2013

Subsystems (4)
lore
Share & tools
lore

Peter Wu

author
#0 lore raw

PATCH 1/1 r8169,sis190: remove unnecessary length check

The ethtool core will lower the requested length to the one returned by get_regs_len, therefore no additional check is needed in the get_regs function.

---
Hi,

This was observed by Ben[1] while reviewing my other r8169 register dump patch. I have combined the r8169 and sis190 patches since they were trivial and both maintained by Francois. Let me know if you prefer to split this trivial patch up.

Regards,
Peter

[1]: http://www.spinics.net/lists/netdev/msg246690.html

---
 drivers/net/ethernet/realtek/r8169.c | 3 ---
 drivers/net/ethernet/sis/sis190.c    | 3 ---
 2 files changed, 6 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -3
index b5eb419..93ee49d 100644
@@ -1898,9 +1898,6 @@ static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
 
-	if (regs->len > R8169_REGS_SIZE)
-		regs->len = R8169_REGS_SIZE;
-
 	rtl_lock_work(tp);
 	memcpy_fromio(p, tp->mmio_addr, regs->len);
 	rtl_unlock_work(tp);
drivers/net/ethernet/sis/sis190.c +0 -3
index 02df089..ee18e6f 100644
@@ -1770,9 +1770,6 @@ static void sis190_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 	struct sis190_private *tp = netdev_priv(dev);
 	unsigned long flags;
 
-	if (regs->len > SIS190_REGS_SIZE)
-		regs->len = SIS190_REGS_SIZE;
-
 	spin_lock_irqsave(&tp->lock, flags);
 	memcpy_fromio(p, tp->mmio_addr, regs->len);
 	spin_unlock_irqrestore(&tp->lock, flags);
Signature · 1 line
1.8.3.4
maintainer
#1 lore raw

Peter Wu <[email protected]> :
[...]

Quoted 4 lines

This was observed by Ben[1] while reviewing my other r8169 register dump patch. I have combined the r8169 and sis190 patches since they were trivial and both maintained by Francois. Let me know if you prefer to split this trivial patch up.

(missed this one)

I'm fine with it.

Signature · 1 line
Ueimor
maintainer Applied
#2 lore raw

From: Francois Romieu <[email protected]>
Date: Tue, 20 Aug 2013 22:45:58 +0200

Quoted 10 lines

Peter Wu <[email protected]> :
[...]

Quoted 4 lines

This was observed by Ben[1] while reviewing my other r8169 register dump patch. I have combined the r8169 and sis190 patches since they were trivial and both maintained by Francois. Let me know if you prefer to split this trivial patch up.

(missed this one)

I'm fine with it.

Applied to net-next, thanks everyone.