mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
bonding: comparing a u8 with -1 is always false
slave->duplex is a u8 type so the in bond_info_show_slave() when we check "if (slave->duplex == -1)", it's always false. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
27d240fdae
commit
589665f5a6
3 changed files with 6 additions and 4 deletions
|
|
@ -560,8 +560,8 @@ static int bond_update_speed_duplex(struct slave *slave)
|
|||
u32 slave_speed;
|
||||
int res;
|
||||
|
||||
slave->speed = -1;
|
||||
slave->duplex = -1;
|
||||
slave->speed = SPEED_UNKNOWN;
|
||||
slave->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
res = __ethtool_get_settings(slave_dev, &ecmd);
|
||||
if (res < 0)
|
||||
|
|
|
|||
|
|
@ -157,12 +157,12 @@ static void bond_info_show_slave(struct seq_file *seq,
|
|||
seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
|
||||
seq_printf(seq, "MII Status: %s\n",
|
||||
(slave->link == BOND_LINK_UP) ? "up" : "down");
|
||||
if (slave->speed == -1)
|
||||
if (slave->speed == SPEED_UNKNOWN)
|
||||
seq_printf(seq, "Speed: %s\n", "Unknown");
|
||||
else
|
||||
seq_printf(seq, "Speed: %d Mbps\n", slave->speed);
|
||||
|
||||
if (slave->duplex == -1)
|
||||
if (slave->duplex == DUPLEX_UNKNOWN)
|
||||
seq_printf(seq, "Duplex: %s\n", "Unknown");
|
||||
else
|
||||
seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half");
|
||||
|
|
|
|||
Loading…
Reference in a new issue