MLK-11911-3 mxc IPUv3: disp: Correct display ID check in ipu_uninit_sync_panel()
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 26 Nov 2015 08:11:17 +0000 (16:11 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:17 +0000 (14:49 -0500)
This patch fixes the following issue reported by Coverity:
Constant expression result (CONSTANT_EXPRESSION_RESULT)
always_true_or: The "or" condition disp != 0 || disp != 1 will always be true
because disp cannot be equal to two different values at the same time, so it
must be not equal to at least one of them.
if ((disp != 0) || (disp != 1))
return;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/mxc/ipu3/ipu_disp.c

index fa73bfa..f2ccb1e 100644 (file)
@@ -1583,7 +1583,7 @@ void ipu_uninit_sync_panel(struct ipu_soc *ipu, int disp)
        uint32_t reg;
        uint32_t di_gen;
 
-       if ((disp != 0) || (disp != 1))
+       if (disp != 0 && disp != 1)
                return;
 
        mutex_lock(&ipu->mutex_lock);