Skip to content

Commit

Permalink
net: usb: pegasus: Replace mdelay() with msleep() in setup_pegasus_II()
Browse files Browse the repository at this point in the history
setup_pegasus_II() 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jia-Ju Bai authored and David S. Miller committed Jul 27, 2018
1 parent 0df125d commit 6dff5ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static inline void setup_pegasus_II(pegasus_t *pegasus)

set_register(pegasus, Reg1d, 0);
set_register(pegasus, Reg7b, 1);
mdelay(100);
msleep(100);
if ((pegasus->features & HAS_HOME_PNA) && mii_mode)
set_register(pegasus, Reg7b, 0);
else
Expand Down

0 comments on commit 6dff5ad

Please sign in to comment.