linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card()
@ 2018-07-27  8:45 Jia-Ju Bai
  2018-07-31  7:25 ` [PATCH] " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2018-07-27  8:45 UTC (permalink / raw)
  To: simon, kvalo; +Cc: linux-wireless, netdev, linux-kernel, 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.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/net/wireless/atmel/atmel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] atmel: Replace mdelay() with msleep() in probe_atmel_card()
  2018-07-27  8:45 [PATCH] net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card() Jia-Ju Bai
@ 2018-07-31  7:25 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-07-31  7:25 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: simon, linux-wireless, netdev, linux-kernel, Jia-Ju Bai

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

-- 
https://patchwork.kernel.org/patch/10546747/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-31  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  8:45 [PATCH] net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card() Jia-Ju Bai
2018-07-31  7:25 ` [PATCH] " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).