Thread (13 messages) 13 messages, 3 authors, 2021-05-14

Re: [PATCH] serial: 8250_omap: fix a timeout loop condition

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2021-04-29 11:08:57
Also in: kernel-janitors

On Thu, Apr 29, 2021 at 10:19:22AM +0300, Dan Carpenter wrote:
This loop ends on -1 so the error message will never be printed.

Fixes: 4bcf59a5dea0 ("serial: 8250: 8250_omap: Account for data in flight during DMA teardown")
Signed-off-by: Dan Carpenter <redacted>
...
 			       poll_count--)
 				cpu_relax();
 
-			if (!poll_count)
+			if (poll_count == -1)
Why not to change poll_count-- to --poll_count?

I would even prefer to replace entire loop with read_poll_timeout_atomic(). But
do we even need atomic here?

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help