Skip to content

Commit

Permalink
r8169,sis190: remove unnecessary length check
Browse files Browse the repository at this point in the history
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.

Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Peter Wu <lekensteyn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Peter Wu authored and David S. Miller committed Aug 20, 2013
1 parent d765bb4 commit e7fb06a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/sis/sis190.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7fb06a

Please sign in to comment.