Skip to contentSkip to conversation

team: Remove dead code

PATCH Applied Kenneth Williams 3 participants 3 messages Jan 12, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 team: Remove dead code

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.

---
 drivers/net/team/team.c |    7 -------
 1 file changed, 7 deletions(-)
drivers/net/team/team.c +0 -7
index 93e2242..43bcfff 100644
@@ -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:
Signature · 1 line
1.7.9.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Mon, Jan 12, 2015 at 01:43:54AM CET, [email protected] 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.

maintainer Applied
#2 lore raw
In reply to Kenneth Williams

From: Kenneth Williams <[email protected]>
Date: Sun, 11 Jan 2015 16:43:54 -0800

Quoted 8 lines

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.

Applied.