Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: cadence-qspi: Fix style and improve readability

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>

authored by

Miquel Raynal (Schneider Electric) and committed by
Mark Brown
aac733a9 9dfc9c1c

+5 -10
+5 -10
drivers/spi/spi-cadence-quadspi.c
··· 374 374 /* Clear interrupt */ 375 375 writel(irq_status, cqspi->iobase + CQSPI_REG_IRQSTATUS); 376 376 377 - if (cqspi->use_dma_read && ddata && ddata->get_dma_status) { 378 - if (ddata->get_dma_status(cqspi)) { 379 - complete(&cqspi->transfer_complete); 380 - return IRQ_HANDLED; 381 - } 382 - } 383 - 384 - else if (!cqspi->slow_sram) 385 - irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR; 386 - else 377 + if (cqspi->use_dma_read && ddata && ddata->get_dma_status) 378 + irq_status = ddata->get_dma_status(cqspi); 379 + else if (cqspi->slow_sram) 387 380 irq_status &= CQSPI_IRQ_MASK_RD_SLOW_SRAM | CQSPI_IRQ_MASK_WR; 381 + else 382 + irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR; 388 383 389 384 if (irq_status) 390 385 complete(&cqspi->transfer_complete);