From: Ansuel Smith Date: Mon, 22 Nov 2021 15:23:40 +0000 (+0100) Subject: net: dsa: qca8k: remove redundant check in parse_port_config X-Git-Tag: v6.1-rc5~2306^2~370^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9133f3ef5a2659730cf47a74bd0a9259f1cf8ff;p=platform%2Fkernel%2Flinux-starfive.git net: dsa: qca8k: remove redundant check in parse_port_config The very next check for port 0 and 6 already makes sure we don't go out of bounds with the ports_config delay table. Remove the redundant check. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index a429c97..bfffc1f 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -983,7 +983,7 @@ qca8k_parse_port_config(struct qca8k_priv *priv) u32 delay; /* We have 2 CPU port. Check them */ - for (port = 0; port < QCA8K_NUM_PORTS && cpu_port_index < QCA8K_NUM_CPU_PORTS; port++) { + for (port = 0; port < QCA8K_NUM_PORTS; port++) { /* Skip every other port */ if (port != 0 && port != 6) continue;