Skip to contentSkip to conversation

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

PATCH In review Jia-Ju Bai 2 participants 2 messages Jul 27, 2018 – Jul 31, 2018

Subsystems (4)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

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

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.

---
 drivers/net/wireless/atmel/atmel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/atmel/atmel.c +1 -1
index d122386c382b..d90f04e14292 100644
@@ -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
Signature · 1 line
2.17.0
#1 lore raw

Re: [PATCH] atmel: Replace mdelay() with msleep() in probe_atmel_card()

Quoted 7 lines · Jia-Ju Bai

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.

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

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

Signature · 3 lines
https://patchwork.kernel.org/patch/10546747/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches