[media] omap3isp: ccdc: Simplify ccdc_lsc_is_configured()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 10 Jun 2014 09:15:33 +0000 (06:15 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:16 +0000 (15:25 -0500)
Use a local variable to avoid the duplicate spin_unlock_irqrestore()
call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/omap3isp/ispccdc.c

index cd62d29d34c4ebe933be327750e49ed9df1bc154..6a62cb76cd1f99d10469a55b108001df79ed5590 100644 (file)
@@ -481,14 +481,13 @@ done:
 static inline int ccdc_lsc_is_configured(struct isp_ccdc_device *ccdc)
 {
        unsigned long flags;
+       int ret;
 
        spin_lock_irqsave(&ccdc->lsc.req_lock, flags);
-       if (ccdc->lsc.active) {
-               spin_unlock_irqrestore(&ccdc->lsc.req_lock, flags);
-               return 1;
-       }
+       ret = ccdc->lsc.active != NULL;
        spin_unlock_irqrestore(&ccdc->lsc.req_lock, flags);
-       return 0;
+
+       return ret;
 }
 
 static int ccdc_lsc_enable(struct isp_ccdc_device *ccdc)