kernel: backport b53/bcm_sf2 changes from v5.8
[openwrt/staging/hauke.git] / target / linux / generic / backport-5.4 / 709-v5.8-0006-net-dsa-b53-remove-redundant-premature-assignment-to.patch
1 From 9f01a71c5cbec10b851588457089d17c20dc5a40 Mon Sep 17 00:00:00 2001
2 From: Colin Ian King <colin.king@canonical.com>
3 Date: Wed, 27 May 2020 13:01:29 +0100
4 Subject: [PATCH] net: dsa: b53: remove redundant premature assignment to
5 new_pvid
6
7 Variable new_pvid is being assigned with a value that is never read,
8 the following if statement updates new_pvid with a new value in both
9 of the if paths. The assignment is redundant and can be removed.
10
11 Addresses-Coverity: ("Unused value")
12 Signed-off-by: Colin Ian King <colin.king@canonical.com>
13 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16 drivers/net/dsa/b53/b53_common.c | 1 -
17 1 file changed, 1 deletion(-)
18
19 --- a/drivers/net/dsa/b53/b53_common.c
20 +++ b/drivers/net/dsa/b53/b53_common.c
21 @@ -1336,7 +1336,6 @@ int b53_vlan_filtering(struct dsa_switch
22 u16 pvid, new_pvid;
23
24 b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid);
25 - new_pvid = pvid;
26 if (!vlan_filtering) {
27 /* Filtering is currently enabled, use the default PVID since
28 * the bridge does not expect tagging anymore