]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_advance_work()
authorTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 15 Dec 2021 11:01:11 +0000 (13:01 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 5 Jan 2022 10:20:03 +0000 (15:50 +0530)
It's easier to read code with fewer levels of indentation, remove a level
of indentation in at_xdmac_advance_work()

if (!foo() & !bar()) {
}

was replaced by:

if (foo() || bar())
return;

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20211215110115.191749-9-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/at_xdmac.c

index eeb03065d4848091d88571ba726384d28bb27f1f..0b09ec752db4f9468a3bf8d916f78ec948938cda 100644 (file)
@@ -1593,14 +1593,14 @@ static void at_xdmac_advance_work(struct at_xdmac_chan *atchan)
         * If channel is enabled, do nothing, advance_work will be triggered
         * after the interruption.
         */
-       if (!at_xdmac_chan_is_enabled(atchan) && !list_empty(&atchan->xfers_list)) {
-               desc = list_first_entry(&atchan->xfers_list,
-                                       struct at_xdmac_desc,
-                                       xfer_node);
-               dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc);
-               if (!desc->active_xfer)
-                       at_xdmac_start_xfer(atchan, desc);
-       }
+       if (at_xdmac_chan_is_enabled(atchan) || list_empty(&atchan->xfers_list))
+               return;
+
+       desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc,
+                               xfer_node);
+       dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc);
+       if (!desc->active_xfer)
+               at_xdmac_start_xfer(atchan, desc);
 }
 
 static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)