Skip to content

Commit 61fac60

Browse files
joabreudavem330
authored andcommitted
net: stmmac: Remove if condition by taking advantage of hwif return code
We can remove the if condition and check if return code is different than -EINVAL, meaning callback is present. Signed-off-by: Jose Abreu <[email protected]> Cc: David S. Miller <[email protected]> Cc: Joao Pinto <[email protected]> Cc: Vitor Soares <[email protected]> Cc: Giuseppe Cavallaro <[email protected]> Cc: Alexandre Torgue <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d2df9ea commit 61fac60

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,7 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
36443644
/* To handle GMAC own interrupts */
36453645
if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) {
36463646
int status = stmmac_host_irq_status(priv, priv->hw, &priv->xstats);
3647+
int mtl_status;
36473648

36483649
if (unlikely(status)) {
36493650
/* For LPI we need to save the tx status */
@@ -3653,20 +3654,18 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
36533654
priv->tx_path_in_lpi_mode = false;
36543655
}
36553656

3656-
if (priv->synopsys_id >= DWMAC_CORE_4_00) {
3657-
for (queue = 0; queue < queues_count; queue++) {
3658-
struct stmmac_rx_queue *rx_q =
3659-
&priv->rx_queue[queue];
3657+
for (queue = 0; queue < queues_count; queue++) {
3658+
struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
36603659

3661-
status |= stmmac_host_mtl_irq_status(priv,
3662-
priv->hw, queue);
3660+
mtl_status = stmmac_host_mtl_irq_status(priv, priv->hw,
3661+
queue);
3662+
if (mtl_status != -EINVAL)
3663+
status |= mtl_status;
36633664

3664-
if (status & CORE_IRQ_MTL_RX_OVERFLOW)
3665-
stmmac_set_rx_tail_ptr(priv,
3666-
priv->ioaddr,
3667-
rx_q->rx_tail_addr,
3668-
queue);
3669-
}
3665+
if (status & CORE_IRQ_MTL_RX_OVERFLOW)
3666+
stmmac_set_rx_tail_ptr(priv, priv->ioaddr,
3667+
rx_q->rx_tail_addr,
3668+
queue);
36703669
}
36713670

36723671
/* PCS link status */

0 commit comments

Comments
 (0)