diff options
-rw-r--r-- | drivers/net/bonding/bond_main.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 16cfe9efee7c..7f2ac499aac2 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -219,24 +219,20 @@ static void bond_deinit(struct net_device *bond_dev); | |||
219 | 219 | ||
220 | static const char *bond_mode_name(int mode) | 220 | static const char *bond_mode_name(int mode) |
221 | { | 221 | { |
222 | switch (mode) { | 222 | static const char *names[] = { |
223 | case BOND_MODE_ROUNDROBIN : | 223 | [BOND_MODE_ROUNDROBIN] = "load balancing (round-robin)", |
224 | return "load balancing (round-robin)"; | 224 | [BOND_MODE_ACTIVEBACKUP] = "fault-tolerance (active-backup)", |
225 | case BOND_MODE_ACTIVEBACKUP : | 225 | [BOND_MODE_XOR] = "load balancing (xor)", |
226 | return "fault-tolerance (active-backup)"; | 226 | [BOND_MODE_BROADCAST] = "fault-tolerance (broadcast)", |
227 | case BOND_MODE_XOR : | 227 | [BOND_MODE_8023AD]= "IEEE 802.3ad Dynamic link aggregation", |
228 | return "load balancing (xor)"; | 228 | [BOND_MODE_TLB] = "transmit load balancing", |
229 | case BOND_MODE_BROADCAST : | 229 | [BOND_MODE_ALB] = "adaptive load balancing", |
230 | return "fault-tolerance (broadcast)"; | 230 | }; |
231 | case BOND_MODE_8023AD: | 231 | |
232 | return "IEEE 802.3ad Dynamic link aggregation"; | 232 | if (mode < 0 || mode > BOND_MODE_ALB) |
233 | case BOND_MODE_TLB: | ||
234 | return "transmit load balancing"; | ||
235 | case BOND_MODE_ALB: | ||
236 | return "adaptive load balancing"; | ||
237 | default: | ||
238 | return "unknown"; | 233 | return "unknown"; |
239 | } | 234 | |
235 | return names[mode]; | ||
240 | } | 236 | } |
241 | 237 | ||
242 | /*---------------------------------- VLAN -----------------------------------*/ | 238 | /*---------------------------------- VLAN -----------------------------------*/ |