mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
bonding: Simplify __get_duplex function.
Eliminate 'else' clause by simply initializing variable Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
12d4309636
commit
b25c2e7d3c
1 changed files with 2 additions and 4 deletions
|
@ -327,14 +327,12 @@ static u16 __get_link_speed(struct port *port)
|
||||||
static u8 __get_duplex(struct port *port)
|
static u8 __get_duplex(struct port *port)
|
||||||
{
|
{
|
||||||
struct slave *slave = port->slave;
|
struct slave *slave = port->slave;
|
||||||
u8 retval;
|
u8 retval = 0x0;
|
||||||
|
|
||||||
/* handling a special case: when the configuration starts with
|
/* handling a special case: when the configuration starts with
|
||||||
* link down, it sets the duplex to 0.
|
* link down, it sets the duplex to 0.
|
||||||
*/
|
*/
|
||||||
if (slave->link != BOND_LINK_UP) {
|
if (slave->link == BOND_LINK_UP) {
|
||||||
retval = 0x0;
|
|
||||||
} else {
|
|
||||||
switch (slave->duplex) {
|
switch (slave->duplex) {
|
||||||
case DUPLEX_FULL:
|
case DUPLEX_FULL:
|
||||||
retval = 0x1;
|
retval = 0x1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue