Skip to contentSkip to conversation

scsi: a100u2w: Replace mdelay() with msleep()

PATCH New Jia-Ju Bai 1 participant 1 message Jul 27, 2018 SCSI

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 scsi: a100u2w: Replace mdelay() with msleep()

wait_chip_ready() and wait_firmware_ready() 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/scsi/a100u2w.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/a100u2w.c +2 -2
index 8086bd0ac9fd..358dfeb1a9c2 100644
@@ -143,7 +143,7 @@ static u8 wait_chip_ready(struct orc_host * host)
 	for (i = 0; i < 10; i++) {	/* Wait 1 second for report timeout     */
 		if (inb(host->base + ORC_HCTRL) & HOSTSTOP)	/* Wait HOSTSTOP set */
 			return 1;
-		mdelay(100);
+		msleep(100);
 	}
 	return 0;
 }
@@ -155,7 +155,7 @@ static u8 wait_firmware_ready(struct orc_host * host)
 	for (i = 0; i < 10; i++) {	/* Wait 1 second for report timeout     */
 		if (inb(host->base + ORC_HSTUS) & RREADY)		/* Wait READY set */
 			return 1;
-		mdelay(100);	/* wait 100ms before try again  */
+		msleep(100);	/* wait 100ms before try again  */
 	}
 	return 0;
 }
Signature · 1 line
2.17.0