drivers: vxlan: fix returnvar.cocci warning
authorGuo Zhengkui <guozhengkui@vivo.com>
Tue, 8 Mar 2022 13:43:09 +0000 (21:43 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Mar 2022 03:40:36 +0000 (19:40 -0800)
Fix the following coccicheck warning:

drivers/net/vxlan/vxlan_core.c:2995:5-8:
Unneeded variable: "ret". Return "0" on line 3004.

Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Acked-by: Roopa Prabhu <roopa@nvidia.com>
Link: https://lore.kernel.org/r/20220308134321.29862-1-guozhengkui@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/vxlan/vxlan_core.c

index e440cdd..3872f76 100644 (file)
@@ -2990,7 +2990,6 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all)
 static int vxlan_stop(struct net_device *dev)
 {
        struct vxlan_dev *vxlan = netdev_priv(dev);
-       int ret = 0;
 
        vxlan_multicast_leave(vxlan);
 
@@ -2999,7 +2998,7 @@ static int vxlan_stop(struct net_device *dev)
        vxlan_flush(vxlan, false);
        vxlan_sock_release(vxlan);
 
-       return ret;
+       return 0;
 }
 
 /* Stub, nothing needs to be done. */