提交 c8fc657e 编写于 作者: R Roel Kluin 提交者: Linus Torvalds

spi: limit reaches -1, tested 0

With a postfix decrement limit will reach -1 rather than 0, so the warning
will not be issued.

Also, add a cpu_relax() into the busy-wait loop.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Cc: Mariusz Ceier <mceier@gmail.com>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 93b61bdd
...@@ -779,7 +779,8 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data) ...@@ -779,7 +779,8 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
/* Read trailing bytes */ /* Read trailing bytes */
limit = loops_per_jiffy << 1; limit = loops_per_jiffy << 1;
while ((read(drv_data) == 0) && limit--); while ((read(drv_data) == 0) && --limit)
cpu_relax();
if (limit == 0) if (limit == 0)
dev_err(&drv_data->pdev->dev, dev_err(&drv_data->pdev->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册