提交 d6aec1ca 编写于 作者: J Jia-Ju Bai 提交者: Martin K. Petersen

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

wait_chip_ready() and wait_firmware_ready() are never called in atomic
context.  They call mdelay() to busy 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: NJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 50838500
...@@ -143,7 +143,7 @@ static u8 wait_chip_ready(struct orc_host * host) ...@@ -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 */ for (i = 0; i < 10; i++) { /* Wait 1 second for report timeout */
if (inb(host->base + ORC_HCTRL) & HOSTSTOP) /* Wait HOSTSTOP set */ if (inb(host->base + ORC_HCTRL) & HOSTSTOP) /* Wait HOSTSTOP set */
return 1; return 1;
mdelay(100); msleep(100);
} }
return 0; return 0;
} }
...@@ -155,7 +155,7 @@ static u8 wait_firmware_ready(struct orc_host * host) ...@@ -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 */ for (i = 0; i < 10; i++) { /* Wait 1 second for report timeout */
if (inb(host->base + ORC_HSTUS) & RREADY) /* Wait READY set */ if (inb(host->base + ORC_HSTUS) & RREADY) /* Wait READY set */
return 1; return 1;
mdelay(100); /* wait 100ms before try again */ msleep(100); /* wait 100ms before try again */
} }
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册