mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
serial: sc16is7xx: improve do/while loop in sc16is7xx_irq()
commitd5078509c8upstream. Simplify and improve readability by replacing while(1) loop with do {} while, and by using the keep_polling variable as the exit condition, making it more explicit. Fixes:8344498721("sc16is7xx: Fix for multi-channel stall") Cc: <stable@vger.kernel.org> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20231221231823.2327894-6-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8ed85bdd1f
commit
5c0471daa8
|
|
@ -782,17 +782,18 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
|
|||
|
||||
static irqreturn_t sc16is7xx_irq(int irq, void *dev_id)
|
||||
{
|
||||
bool keep_polling;
|
||||
|
||||
struct sc16is7xx_port *s = (struct sc16is7xx_port *)dev_id;
|
||||
|
||||
while (1) {
|
||||
bool keep_polling = false;
|
||||
do {
|
||||
int i;
|
||||
|
||||
keep_polling = false;
|
||||
|
||||
for (i = 0; i < s->devtype->nr_uart; ++i)
|
||||
keep_polling |= sc16is7xx_port_irq(s, i);
|
||||
if (!keep_polling)
|
||||
break;
|
||||
}
|
||||
} while (keep_polling);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user