]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers/crypto/fsl: remove redundant logical contraint
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Sat, 15 Apr 2017 14:37:54 +0000 (16:37 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 18 Apr 2017 14:29:25 +0000 (10:29 -0400)
'A || (!A && B)' is equivalent to 'A || B'.
Let's reduce the complexity of the statement in start_jr0().

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/crypto/fsl/jr.c

index 1b882291e4f9ae306d6ee6c8a103f305d6fe1956..c33777fc7dd04edd7ef069882f4ab399767d4aea 100644 (file)
@@ -47,8 +47,7 @@ static inline void start_jr0(uint8_t sec_idx)
                 * VIRT_EN_INCL = 1 & VIRT_EN_POR = 0 & SEC_SCFGR_VIRT_EN = 1
                 */
                if ((ctpr_ms & SEC_CTPR_MS_VIRT_EN_POR) ||
-                   (!(ctpr_ms & SEC_CTPR_MS_VIRT_EN_POR) &&
-                                       (scfgr & SEC_SCFGR_VIRT_EN)))
+                   (scfgr & SEC_SCFGR_VIRT_EN))
                        sec_out32(&sec->jrstartr, CONFIG_JRSTARTR_JR0);
        } else {
                /* VIRT_EN_INCL = 0 && VIRT_EN_POR_VALUE = 1 */