提交 b25c2e7d 编写于 作者: M Mahesh Bandewar 提交者: David S. Miller

bonding: Simplify __get_duplex function.

Eliminate 'else' clause by simply initializing variable
Signed-off-by: NMahesh Bandewar <maheshb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 12d43096
......@@ -327,14 +327,12 @@ static u16 __get_link_speed(struct port *port)
static u8 __get_duplex(struct port *port)
{
struct slave *slave = port->slave;
u8 retval;
u8 retval = 0x0;
/* handling a special case: when the configuration starts with
* link down, it sets the duplex to 0.
*/
if (slave->link != BOND_LINK_UP) {
retval = 0x0;
} else {
if (slave->link == BOND_LINK_UP) {
switch (slave->duplex) {
case DUPLEX_FULL:
retval = 0x1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册