diff options
author | Niklas Cassel <niklas.cassel@axis.com> | 2018-02-09 11:22:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-09 14:23:04 -0500 |
commit | 1029117127540fef4edcf4f0887dc3e1f7d5adb2 (patch) | |
tree | ebec54574b541a88c0465c9a2b59ce45ace5faa1 | |
parent | e879b7ab3739d8f9990961fc7df2f63861bd780b (diff) |
net: stmmac: remove redundant enable of PMT irq
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>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index 540d21786a43..ef10baf14186 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | |||
@@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw, | |||
74 | /* Mask GMAC interrupts */ | 74 | /* Mask GMAC interrupts */ |
75 | value = GMAC_INT_DEFAULT_MASK; | 75 | value = GMAC_INT_DEFAULT_MASK; |
76 | 76 | ||
77 | if (hw->pmt) | ||
78 | value &= ~GMAC_INT_DISABLE_PMT; | ||
79 | if (hw->pcs) | 77 | if (hw->pcs) |
80 | value &= ~GMAC_INT_DISABLE_PCS; | 78 | value &= ~GMAC_INT_DISABLE_PCS; |
81 | 79 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 6badc63d8e6d..63795ecafc8d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | |||
@@ -63,8 +63,7 @@ static void dwmac4_core_init(struct mac_device_info *hw, | |||
63 | 63 | ||
64 | /* Enable GMAC interrupts */ | 64 | /* Enable GMAC interrupts */ |
65 | value = GMAC_INT_DEFAULT_ENABLE; | 65 | value = GMAC_INT_DEFAULT_ENABLE; |
66 | if (hw->pmt) | 66 | |
67 | value |= GMAC_INT_PMT_EN; | ||
68 | if (hw->pcs) | 67 | if (hw->pcs) |
69 | value |= GMAC_PCS_IRQ_DEFAULT; | 68 | value |= GMAC_PCS_IRQ_DEFAULT; |
70 | 69 | ||