Skip to content

Commit

Permalink
net-bonding: Fix minor/cosmetic type inconsistencies
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Decotigny authored and David S. Miller committed Apr 15, 2011
1 parent d30ee67 commit 65cce19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,9 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val)
static u32 __get_agg_bandwidth(struct aggregator *aggregator)
{
u32 bandwidth = 0;
u32 basic_speed;

if (aggregator->num_of_ports) {
basic_speed = __get_link_speed(aggregator->lag_ports);
switch (basic_speed) {
switch (__get_link_speed(aggregator->lag_ports)) {
case AD_LINK_SPEED_BITMASK_1MBPS:
bandwidth = aggregator->num_of_ports;
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3340,7 +3340,7 @@ static int bond_slave_netdev_event(unsigned long event,
slave = bond_get_slave_by_dev(bond, slave_dev);
if (slave) {
u16 old_speed = slave->speed;
u16 old_duplex = slave->duplex;
u8 old_duplex = slave->duplex;

bond_update_speed_duplex(slave);

Expand Down

0 comments on commit 65cce19

Please sign in to comment.