diff mbox

[net-next] team: Simplify return path of team_newlink

Message ID 1407221930-15590-1-git-send-email-makita.toshiaki@lab.ntt.co.jp
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Toshiaki Makita Aug. 5, 2014, 6:58 a.m. UTC
The variable "err" is not necessary.
Return register_netdevice() directly.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
 drivers/net/team/team.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Jiri Pirko Aug. 5, 2014, 7:06 a.m. UTC | #1
Tue, Aug 05, 2014 at 08:58:50AM CEST, makita.toshiaki@lab.ntt.co.jp wrote:
>The variable "err" is not necessary.
>Return register_netdevice() directly.
>
>Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

Acked-by: Jiri Pirko <jiri@resnulli.us>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Aug. 5, 2014, 11:38 p.m. UTC | #2
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Tue,  5 Aug 2014 15:58:50 +0900

> The variable "err" is not necessary.
> Return register_netdevice() directly.
> 
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index b4958c7..ef10302 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2045,16 +2045,10 @@  static void team_setup(struct net_device *dev)
 static int team_newlink(struct net *src_net, struct net_device *dev,
 			struct nlattr *tb[], struct nlattr *data[])
 {
-	int err;
-
 	if (tb[IFLA_ADDRESS] == NULL)
 		eth_hw_addr_random(dev);
 
-	err = register_netdevice(dev);
-	if (err)
-		return err;
-
-	return 0;
+	return register_netdevice(dev);
 }
 
 static int team_validate(struct nlattr *tb[], struct nlattr *data[])