Skip to content

Commit

Permalink
igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback()
Browse files Browse the repository at this point in the history
igb_integrated_phy_loopback() is never called in atomic context.
It calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Jia-Ju Bai authored and Jeff Kirsher committed Aug 24, 2018
1 parent 1513562 commit 69a6465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
if (hw->phy.type == e1000_phy_m88)
igb_phy_disable_receiver(adapter);

mdelay(500);
msleep(500);
return 0;
}

Expand Down

0 comments on commit 69a6465

Please sign in to comment.