From e198286b9150da95a1ed29558f73c69f3b397891 Mon Sep 17 00:00:00 2001
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Fri, 9 Feb 2018 17:22:47 +0100
Subject: [PATCH 14/21] net: stmmac: remove redundant enable of PMT irq
Git-commit: 1029117127540fef4edcf4f0887dc3e1f7d5adb2
Patch-mainline: v4.16-rc1
References: git-fixes
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>
Signed-off-by: Denis Kirjanov <denis.kirjanov@suse.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 --
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index e97a0b4541c1..f3df4cf0cb6a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -72,8 +72,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;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 16d785b5c0e0..f4c60a98fc48 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -61,8 +61,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;
--
2.16.4