Skip to content

Commit 1029117

Browse files
Niklas Casseldavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e879b7a commit 1029117

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
7474
/* Mask GMAC interrupts */
7575
value = GMAC_INT_DEFAULT_MASK;
7676

77-
if (hw->pmt)
78-
value &= ~GMAC_INT_DISABLE_PMT;
7977
if (hw->pcs)
8078
value &= ~GMAC_INT_DISABLE_PCS;
8179

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ static void dwmac4_core_init(struct mac_device_info *hw,
6363

6464
/* Enable GMAC interrupts */
6565
value = GMAC_INT_DEFAULT_ENABLE;
66-
if (hw->pmt)
67-
value |= GMAC_INT_PMT_EN;
66+
6867
if (hw->pcs)
6968
value |= GMAC_PCS_IRQ_DEFAULT;
7069

0 commit comments

Comments
 (0)