summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sun/cassini.c
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2022-03-04 09:36:53 +0100
committerDavid S. Miller <davem@davemloft.net>2022-03-04 14:07:54 +0100
commit1039135aedfc5021b4827eb87276d7b4272024ac (patch)
treeaa31bdbc291ef84a9e153e4d3a2838f3ed88f015 /drivers/net/ethernet/sun/cassini.c
parentMerge branch 'nfp-AF_XDP-zero-copy' (diff)
downloadlinux-1039135aedfc5021b4827eb87276d7b4272024ac.tar.xz
linux-1039135aedfc5021b4827eb87276d7b4272024ac.zip
net: ethernet: sun: Remove redundant code
Since the starting value in the for loop is greater than or equal to 1, the restriction is CAS_FLAG_REG_PLUS is in the file cassini.h is defined as 0x1 by macro, and the for loop and if condition is not satisfied, so the code here is redundant. Clean up the following smatch warning: drivers/net/ethernet/sun/cassini.c:3513 cas_start_dma() warn: we never enter this loop. drivers/net/ethernet/sun/cassini.c:1239 cas_init_rx_dma() warn: we never enter this loop. drivers/net/ethernet/sun/cassini.c:1247 cas_init_rx_dma() warn: we never enter this loop. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/cassini.c')
-rw-r--r--drivers/net/ethernet/sun/cassini.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index 947a76a788c7..153edc5eadad 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -1235,19 +1235,6 @@ static void cas_init_rx_dma(struct cas *cp)
*/
readl(cp->regs + REG_INTR_STATUS_ALIAS);
writel(INTR_RX_DONE | INTR_RX_BUF_UNAVAIL, cp->regs + REG_ALIAS_CLEAR);
- if (cp->cas_flags & CAS_FLAG_REG_PLUS) {
- for (i = 1; i < N_RX_COMP_RINGS; i++)
- readl(cp->regs + REG_PLUS_INTRN_STATUS_ALIAS(i));
-
- /* 2 is different from 3 and 4 */
- if (N_RX_COMP_RINGS > 1)
- writel(INTR_RX_DONE_ALT | INTR_RX_BUF_UNAVAIL_1,
- cp->regs + REG_PLUS_ALIASN_CLEAR(1));
-
- for (i = 2; i < N_RX_COMP_RINGS; i++)
- writel(INTR_RX_DONE_ALT,
- cp->regs + REG_PLUS_ALIASN_CLEAR(i));
- }
/* set up pause thresholds */
val = CAS_BASE(RX_PAUSE_THRESH_OFF,
@@ -3509,9 +3496,6 @@ enable_rx_done:
if (N_RX_DESC_RINGS > 1)
writel(RX_DESC_RINGN_SIZE(1) - 4,
cp->regs + REG_PLUS_RX_KICK1);
-
- for (i = 1; i < N_RX_COMP_RINGS; i++)
- writel(0, cp->regs + REG_PLUS_RX_COMPN_TAIL(i));
}
}