Commit 9e6c3b63 authored by David Ertman's avatar David Ertman Committed by Jeff Kirsher

e1000e: fix compiler warnings

This patch is to fix a compiler warning of __bad_udelay due to a value
of >999 being passed as a parameter to udelay() in the function
e1000e_phy_has_link_generic().  This affects the gcc compiler when
it is given a flag of -O3 and the icc compiler.

This patch is also making the change from mdelay() to msleep() in the
same function, since it was determined though code inspection that this
function is never called in atomic context.
Signed-off-by: default avatarDavid Ertman <davidx.m.ertman@intel.com>
Acked-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 85328240
...@@ -1757,19 +1757,23 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, ...@@ -1757,19 +1757,23 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
* it across the board. * it across the board.
*/ */
ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
if (ret_val) if (ret_val) {
/* If the first read fails, another entity may have /* If the first read fails, another entity may have
* ownership of the resources, wait and try again to * ownership of the resources, wait and try again to
* see if they have relinquished the resources yet. * see if they have relinquished the resources yet.
*/ */
if (usec_interval >= 1000)
msleep(usec_interval / 1000);
else
udelay(usec_interval); udelay(usec_interval);
}
ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
if (ret_val) if (ret_val)
break; break;
if (phy_status & BMSR_LSTATUS) if (phy_status & BMSR_LSTATUS)
break; break;
if (usec_interval >= 1000) if (usec_interval >= 1000)
mdelay(usec_interval / 1000); msleep(usec_interval / 1000);
else else
udelay(usec_interval); udelay(usec_interval);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment