Commit d818c59a authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller

net: jme: Replace mdelay() with msleep() and usleep_range() in jme_wait_link()

jme_wait_link() is never called in atomic context.
It calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep() and usleep_range().

This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89036f23
...@@ -1911,10 +1911,10 @@ jme_wait_link(struct jme_adapter *jme) ...@@ -1911,10 +1911,10 @@ jme_wait_link(struct jme_adapter *jme)
{ {
u32 phylink, to = JME_WAIT_LINK_TIME; u32 phylink, to = JME_WAIT_LINK_TIME;
mdelay(1000); msleep(1000);
phylink = jme_linkstat_from_phy(jme); phylink = jme_linkstat_from_phy(jme);
while (!(phylink & PHY_LINK_UP) && (to -= 10) > 0) { while (!(phylink & PHY_LINK_UP) && (to -= 10) > 0) {
mdelay(10); usleep_range(10000, 11000);
phylink = jme_linkstat_from_phy(jme); phylink = jme_linkstat_from_phy(jme);
} }
} }
......
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