[PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup

From: menglong8 . dong
Date: Wed Nov 04 2020 - 20:54:45 EST


From: Menglong Dong <dong.menglong@xxxxxxxxxx>

The initialization for err with 0 seems useless, as it is soon updated
with -ENOMEM. So, we can remove it.

Changes since v1:
-Keep -ENOMEM still.

Signed-off-by: Menglong Dong <dong.menglong@xxxxxxxxxx>
---
drivers/net/macvlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index dd96020..d9b6c44 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1096,7 +1096,7 @@ static int macvlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info
struct macvlan_dev *vlan = netdev_priv(dev);
struct net_device *real_dev = vlan->lowerdev;
struct netpoll *netpoll;
- int err = 0;
+ int err;

netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL);
err = -ENOMEM;
--
2.7.4