From: Peter Wu Date: Fri, 16 Aug 2013 23:07:53 +0000 (+0200) Subject: r8169,sis190: remove unnecessary length check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e7fb06a1b4d1c5bdcbbf78f7c7e938835395bcdb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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. Reported-by: Ben Hutchings Signed-off-by: Peter Wu Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index b5eb4195fc99..93ee49d29317 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -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); diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c index 02df0894690d..ee18e6f7b4fe 100644 --- a/drivers/net/ethernet/sis/sis190.c +++ b/drivers/net/ethernet/sis/sis190.c @@ -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);