From: Laurent Pinchart Date: Tue, 10 Jun 2014 09:15:33 +0000 (-0300) Subject: [media] omap3isp: ccdc: Simplify ccdc_lsc_is_configured() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c74817405d42572db2071b0b4a9609b487c91a7;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [media] omap3isp: ccdc: Simplify ccdc_lsc_is_configured() Use a local variable to avoid the duplicate spin_unlock_irqrestore() call. Signed-off-by: Laurent Pinchart Tested-by: Enrico Butera Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index cd62d29d34c4..6a62cb76cd1f 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -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)