For loop contains only an if conditional (and body of if conditional).
Conditional can be inverted and the loop continued if the new
conditional is true without modifying the program logic. This allows
one level of indentation to be removed.

Invert conditional and continue loop if new conditional evaluates to
true. Remove one level of indentation from subsequent loop body.

Signed-off-by: Tobin C. Harding <[email protected]>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
b/drivers/staging/comedi/drivers/cb_pcidas64.c
index cb9c269..352f754 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1497,16 +1497,16 @@ static int alloc_and_init_dma_members(struct 
comedi_device *dev)
                        return -ENOMEM;
        }
        for (i = 0; i < AO_DMA_RING_COUNT; i++) {
-               if (ao_cmd_is_supported(board)) {
-                       devpriv->ao_buffer[i] =
-                               dma_alloc_coherent(&pcidev->dev,
-                                                  DMA_BUFFER_SIZE,
-                                                  &devpriv->
-                                                  ao_buffer_bus_addr[i],
-                                                  GFP_KERNEL);
-                       if (!devpriv->ao_buffer[i])
-                               return -ENOMEM;
-               }
+               if (!ao_cmd_is_supported(board))
+                       continue;
+               devpriv->ao_buffer[i] =
+                       dma_alloc_coherent(&pcidev->dev,
+                                       DMA_BUFFER_SIZE,
+                                       &devpriv->
+                                       ao_buffer_bus_addr[i],
+                                       GFP_KERNEL);
+               if (!devpriv->ao_buffer[i])
+                       return -ENOMEM;
        }
        /* allocate dma descriptors */
        devpriv->ai_dma_desc =
-- 
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to