diff mbox series

net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card()

Message ID 20180727084535.3848-1-baijiaju1990@gmail.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show
Series net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card() | expand

Commit Message

Jia-Ju Bai July 27, 2018, 8:45 a.m. UTC
probe_atmel_card() 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>
---
 drivers/net/wireless/atmel/atmel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo July 31, 2018, 7:25 a.m. UTC | #1
Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> probe_atmel_card() 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>

Patch applied to wireless-drivers-next.git, thanks.

5685bee313e9 atmel: Replace mdelay() with msleep() in probe_atmel_card()
diff mbox series

Patch

diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c
index d122386c382b..d90f04e14292 100644
--- a/drivers/net/wireless/atmel/atmel.c
+++ b/drivers/net/wireless/atmel/atmel.c
@@ -3692,7 +3692,7 @@  static int probe_atmel_card(struct net_device *dev)
 		atmel_write16(dev, GCR, 0x0060);
 
 	atmel_write16(dev, GCR, 0x0040);
-	mdelay(500);
+	msleep(500);
 
 	if (atmel_read16(dev, MR2) == 0) {
 		/* No stored firmware so load a small stub which just