diff mbox

team: Remove dead code

Message ID 20150112004351.GA8744@ubuntu
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Kenneth Williams Jan. 12, 2015, 12:43 a.m. UTC
The deleted lines are called from a function which is called:
1) Only through __team_options_register via team_options_register and
2) Only during initialization / mode initialization when there are no
ports attached.
Therefore the ports list is guarenteed to be empty and this code will
never be executed.

Signed-off-by: Kenneth Williams <ken@williamsclan.us>
---
 drivers/net/team/team.c |    7 -------
 1 file changed, 7 deletions(-)

Comments

Jiri Pirko Jan. 12, 2015, 7:10 a.m. UTC | #1
Mon, Jan 12, 2015 at 01:43:54AM CET, ken@williamsclan.us wrote:
>The deleted lines are called from a function which is called:
>1) Only through __team_options_register via team_options_register and
>2) Only during initialization / mode initialization when there are no
>ports attached.
>Therefore the ports list is guarenteed to be empty and this code will
>never be executed.
>
>Signed-off-by: Kenneth Williams <ken@williamsclan.us>

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 Jan. 12, 2015, 10:02 p.m. UTC | #2
From: Kenneth Williams <ken@williamsclan.us>
Date: Sun, 11 Jan 2015 16:43:54 -0800

> The deleted lines are called from a function which is called:
> 1) Only through __team_options_register via team_options_register and
> 2) Only during initialization / mode initialization when there are no
> ports attached.
> Therefore the ports list is guarenteed to be empty and this code will
> never be executed.
> 
> Signed-off-by: Kenneth Williams <ken@williamsclan.us>

Applied.
--
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 93e2242..43bcfff 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -176,7 +176,6 @@  static int __team_option_inst_add(struct team *team, struct team_option *option,
 static int __team_option_inst_add_option(struct team *team,
 					 struct team_option *option)
 {
-	struct team_port *port;
 	int err;
 
 	if (!option->per_port) {
@@ -184,12 +183,6 @@  static int __team_option_inst_add_option(struct team *team,
 		if (err)
 			goto inst_del_option;
 	}
-
-	list_for_each_entry(port, &team->port_list, list) {
-		err = __team_option_inst_add(team, option, port);
-		if (err)
-			goto inst_del_option;
-	}
 	return 0;
 
 inst_del_option: