[bug report] net: ethernet: ti: am65-cpsw-nuss: restore vlan configuration while down/up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Grygorii Strashko,

The patch 7bcffde02152: "net: ethernet: ti: am65-cpsw-nuss: restore
vlan configuration while down/up" from Jun 26, 2020, leads to the
following Smatch static checker warning:

	drivers/net/ethernet/ti/am65-cpsw-nuss.c:188 am65_cpsw_nuss_ndo_slave_add_vid()
	warn: duplicate check 'vid' (previous on line 180)

drivers/net/ethernet/ti/am65-cpsw-nuss.c
    169 static int am65_cpsw_nuss_ndo_slave_add_vid(struct net_device *ndev,
    170                                             __be16 proto, u16 vid)
    171 {
    172         struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
    173         struct am65_cpsw_port *port = am65_ndev_to_port(ndev);
    174         u32 port_mask, unreg_mcast = 0;
    175         int ret;
    176 
    177         if (!common->is_emac_mode)
    178                 return 0;
    179 
    180         if (!netif_running(ndev) || !vid)
                                            ^^^^
If "vid" is zero then we return here.

    181                 return 0;
    182 
    183         ret = pm_runtime_resume_and_get(common->dev);
    184         if (ret < 0)
    185                 return ret;
    186 
    187         port_mask = BIT(port->port_id) | ALE_PORT_HOST;
--> 188         if (!vid)
    189                 unreg_mcast = port_mask;
    190         dev_info(common->dev, "Adding vlan %d to vlan filter\n", vid);
    191         ret = cpsw_ale_vlan_add_modify(common->ale, vid, port_mask,
    192                                        unreg_mcast, port_mask, 0);

So we chould just remove the unreg_mcast variable and call?:

	ret = cpsw_ale_vlan_add_modify(common->ale, vid, port_mask,
				       port_mask, port_mask, 0);

    193 
    194         pm_runtime_put(common->dev);
    195         return ret;
    196 }

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux