* [PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup
@ 2020-11-05 1:54 menglong8.dong
2020-11-07 20:20 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: menglong8.dong @ 2020-11-05 1:54 UTC (permalink / raw)
To: kuba; +Cc: davem, netdev, linux-kernel, dingtianhong, Menglong Dong
From: Menglong Dong <dong.menglong@zte.com.cn>
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@zte.com.cn>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup
2020-11-05 1:54 [PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup menglong8.dong
@ 2020-11-07 20:20 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-11-07 20:20 UTC (permalink / raw)
To: menglong8.dong; +Cc: davem, netdev, linux-kernel, dingtianhong, Menglong Dong
On Wed, 4 Nov 2020 20:54:04 -0500 menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>
>
> 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@zte.com.cn>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-07 20:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-05 1:54 [PATCH v2] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup menglong8.dong
2020-11-07 20:20 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).