Staging: media: omap24xx: Fix else is not useful warning
authorMahati Chamarthy <mahati.chamarthy@gmail.com>
Tue, 23 Sep 2014 16:39:23 +0000 (22:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 03:33:23 +0000 (20:33 -0700)
This fixes the following checkpatch.pl warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/omap24xx/omap24xxcam-dma.c

index 9c00776d658331a052641c043b7b3a2146fb2089..afb9e0870b6ab2f663d889b391a884c92e219860 100644 (file)
@@ -149,8 +149,8 @@ static void omap24xxcam_dmahw_transfer_chain(void __iomem *base, int dmach,
                         */
                        omap24xxcam_dmahw_transfer_start(base, dmach);
                        break;
-               } else
-                       ch = (ch + 1) % NUM_CAMDMA_CHANNELS;
+               }
+               ch = (ch + 1) % NUM_CAMDMA_CHANNELS;
        }
 }
 
@@ -332,15 +332,14 @@ void omap24xxcam_dma_isr(struct omap24xxcam_dma *dma)
                        spin_unlock(&dma->lock);
                        omap24xxcam_dma_stop(dma, csr);
                        return;
-               } else {
-                       callback = dma->ch_state[dmach].callback;
-                       arg = dma->ch_state[dmach].arg;
-                       dma->free_dmach++;
-                       if (callback) {
-                               spin_unlock(&dma->lock);
-                               (*callback) (dma, csr, arg);
-                               spin_lock(&dma->lock);
-                       }
+               }
+               callback = dma->ch_state[dmach].callback;
+               arg = dma->ch_state[dmach].arg;
+               dma->free_dmach++;
+               if (callback) {
+                       spin_unlock(&dma->lock);
+                       (*callback) (dma, csr, arg);
+                       spin_lock(&dma->lock);
                }
        }
 
@@ -475,17 +474,16 @@ void omap24xxcam_sgdma_process(struct omap24xxcam_sgdma *sgdma)
                                /* DMA start failed */
                                spin_unlock_irqrestore(&sgdma->lock, flags);
                                return;
-                       } else {
-                               unsigned long expires;
-                               /* DMA start was successful */
-                               sg_state->next_sglist++;
-                               sg_state->bytes_read += len;
-                               sg_state->queued_sglist++;
-
-                               /* We start the reset timer */
-                               expires = jiffies + HZ;
-                               mod_timer(&sgdma->reset_timer, expires);
                        }
+                       unsigned long expires;
+                       /* DMA start was successful */
+                       sg_state->next_sglist++;
+                       sg_state->bytes_read += len;
+                       sg_state->queued_sglist++;
+
+                       /* We start the reset timer */
+                       expires = jiffies + HZ;
+                       mod_timer(&sgdma->reset_timer, expires);
                }
                queued_sgdma--;
                sgslot = (sgslot + 1) % NUM_SG_DMA;