]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: stmmac: remove redundant enable of PMT irq
authorNiklas Cassel <niklas.cassel@axis.com>
Fri, 9 Feb 2018 16:22:47 +0000 (17:22 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Feb 2018 19:23:04 +0000 (14:23 -0500)
For dwmac4, GMAC_INT_DEFAULT_ENABLE already includes
GMAC_INT_PMT_EN, so it is redundant to check if hw->pmt
is set, and if so, setting the bit again.

For dwmac1000, GMAC_INT_DEFAULT_MASK does not include
GMAC_INT_DISABLE_PMT, so it is redundant to check if
hw->pmt is set, and if so, clearing an already cleared bit.

Improve code readability by removing this redundant code.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

index 540d21786a43b885fc98f2d5282538bf20792bfe..ef10baf14186267a4c7cd11602258f3ec893b77d 100644 (file)
@@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
        /* Mask GMAC interrupts */
        value = GMAC_INT_DEFAULT_MASK;
 
-       if (hw->pmt)
-               value &= ~GMAC_INT_DISABLE_PMT;
        if (hw->pcs)
                value &= ~GMAC_INT_DISABLE_PCS;
 
index 6badc63d8e6d35adec64d712b315e32e0c0c5ff1..63795ecafc8dc0f1d8ac1d9086f259a38802613c 100644 (file)
@@ -63,8 +63,7 @@ static void dwmac4_core_init(struct mac_device_info *hw,
 
        /* Enable GMAC interrupts */
        value = GMAC_INT_DEFAULT_ENABLE;
-       if (hw->pmt)
-               value |= GMAC_INT_PMT_EN;
+
        if (hw->pcs)
                value |= GMAC_PCS_IRQ_DEFAULT;