Skip to contentSkip to conversation

firewire: init_ohci1394_dma: Replace mdelay with msleep

PATCH New Jia-Ju Bai 1 participant 1 message Jul 23, 2018 Firewire

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 firewire: init_ohci1394_dma: Replace mdelay with msleep

init_ohci1394_wait_for_busresets() and init_ohci1394_reset_and_init_dma() are never called in atomic context.

They call 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/firewire/init_ohci1394_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firewire/init_ohci1394_dma.c +2 -2
index 2cc89ce745c9..6b5a3c12f715 100644
@@ -192,7 +192,7 @@ static inline void __init init_ohci1394_wait_for_busresets(struct ohci *ohci)
 	int i, events;
 
 	for (i = 0; i < 9; i++) {
-		mdelay(200);
+		msleep(200);
 		events = reg_read(ohci, OHCI1394_IntEventSet);
 		if (events & OHCI1394_busReset)
 			reg_write(ohci, OHCI1394_IntEventClear,
@@ -228,7 +228,7 @@ static inline void __init init_ohci1394_reset_and_init_dma(struct ohci *ohci)
 	reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
 	reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
 
-	mdelay(50); /* Wait 50msec to make sure we have full link enabled */
+	msleep(50); /* Wait 50msec to make sure we have full link enabled */
 
 	init_ohci1394_initialize(ohci);
 	/*
Signature · 1 line
2.17.0