Commit d6b76a45 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul

dmaengine: hsu: using for_each_set_bit to simplify the code

It's more cleanly to use for_each_set_bit() instead of opencoding it.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220713172235.22611-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d5988dcc
...@@ -26,22 +26,19 @@ ...@@ -26,22 +26,19 @@
static irqreturn_t hsu_pci_irq(int irq, void *dev) static irqreturn_t hsu_pci_irq(int irq, void *dev)
{ {
struct hsu_dma_chip *chip = dev; struct hsu_dma_chip *chip = dev;
u32 dmaisr; unsigned long dmaisr;
u32 status;
unsigned short i; unsigned short i;
u32 status;
int ret = 0; int ret = 0;
int err; int err;
dmaisr = readl(chip->regs + HSU_PCI_DMAISR); dmaisr = readl(chip->regs + HSU_PCI_DMAISR);
for (i = 0; i < chip->hsu->nr_channels; i++) { for_each_set_bit(i, &dmaisr, chip->hsu->nr_channels) {
if (dmaisr & 0x1) { err = hsu_dma_get_status(chip, i, &status);
err = hsu_dma_get_status(chip, i, &status); if (err > 0)
if (err > 0) ret |= 1;
ret |= 1; else if (err == 0)
else if (err == 0) ret |= hsu_dma_do_irq(chip, i, status);
ret |= hsu_dma_do_irq(chip, i, status);
}
dmaisr >>= 1;
} }
return IRQ_RETVAL(ret); return IRQ_RETVAL(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment