]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: cadence-qspi: Fix style and improve readability
authorMiquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Thu, 22 Jan 2026 15:13:29 +0000 (16:13 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jan 2026 20:41:20 +0000 (20:41 +0000)
It took me several seconds to correctly understand this block. I
understand the goal: showing that we are in the if, or in one of the two
other cases. Improve the organization of the code to both improve
readability and fix the style.

Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Tested-by: Santhosh Kumar K <s-k6@ti.com>
Link: https://patch.msgid.link/20260122-schneider-6-19-rc1-qspi-v4-4-f9c21419a3e6@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c

index e6eb3fa5d689ce799993404e519b8b9615237737..75010f35da41853ac9c9fa3e90d1a8061e209ef7 100644 (file)
@@ -374,17 +374,12 @@ static irqreturn_t cqspi_irq_handler(int this_irq, void *dev)
        /* Clear interrupt */
        writel(irq_status, cqspi->iobase + CQSPI_REG_IRQSTATUS);
 
-       if (cqspi->use_dma_read && ddata && ddata->get_dma_status) {
-               if (ddata->get_dma_status(cqspi)) {
-                       complete(&cqspi->transfer_complete);
-                       return IRQ_HANDLED;
-               }
-       }
-
-       else if (!cqspi->slow_sram)
-               irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
-       else
+       if (cqspi->use_dma_read && ddata && ddata->get_dma_status)
+               irq_status = ddata->get_dma_status(cqspi);
+       else if (cqspi->slow_sram)
                irq_status &= CQSPI_IRQ_MASK_RD_SLOW_SRAM | CQSPI_IRQ_MASK_WR;
+       else
+               irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
 
        if (irq_status)
                complete(&cqspi->transfer_complete);