diff options
author | David Decotigny <decot@google.com> | 2011-04-13 11:22:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-15 01:00:32 -0400 |
commit | 65cce19c07756c2b2b51595c967dda93b0727027 (patch) | |
tree | df3f51653b8dccced401c902d8566f068c735cfc | |
parent | d30ee670f25ea8f265a2804e2a0a53804cac5185 (diff) |
net-bonding: Fix minor/cosmetic type inconsistencies
The __get_link_speed() function returns a u16 value which was stored
in a u32 local variable. This patch uses the return value directly,
thus fixing that minor type consistency.
The 'duplex' field in struct slave being encoded on 8 bits, to be more
consistent we use a u8 integer (instead of u16) whenever we copy it to
local variables.
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 494bf960442d..123dd602261f 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -716,11 +716,9 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val) | |||
716 | static u32 __get_agg_bandwidth(struct aggregator *aggregator) | 716 | static u32 __get_agg_bandwidth(struct aggregator *aggregator) |
717 | { | 717 | { |
718 | u32 bandwidth = 0; | 718 | u32 bandwidth = 0; |
719 | u32 basic_speed; | ||
720 | 719 | ||
721 | if (aggregator->num_of_ports) { | 720 | if (aggregator->num_of_ports) { |
722 | basic_speed = __get_link_speed(aggregator->lag_ports); | 721 | switch (__get_link_speed(aggregator->lag_ports)) { |
723 | switch (basic_speed) { | ||
724 | case AD_LINK_SPEED_BITMASK_1MBPS: | 722 | case AD_LINK_SPEED_BITMASK_1MBPS: |
725 | bandwidth = aggregator->num_of_ports; | 723 | bandwidth = aggregator->num_of_ports; |
726 | break; | 724 | break; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 94a371c12d70..4df674bc6f12 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3340,7 +3340,7 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3340 | slave = bond_get_slave_by_dev(bond, slave_dev); | 3340 | slave = bond_get_slave_by_dev(bond, slave_dev); |
3341 | if (slave) { | 3341 | if (slave) { |
3342 | u16 old_speed = slave->speed; | 3342 | u16 old_speed = slave->speed; |
3343 | u16 old_duplex = slave->duplex; | 3343 | u8 old_duplex = slave->duplex; |
3344 | 3344 | ||
3345 | bond_update_speed_duplex(slave); | 3345 | bond_update_speed_duplex(slave); |
3346 | 3346 | ||