* [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint
@ 2017-04-15 14:37 Heinrich Schuchardt
2017-04-15 16:46 ` York Sun
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2017-04-15 14:37 UTC (permalink / raw)
To: u-boot
'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>
---
drivers/crypto/fsl/jr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c
index 1b882291e4..c33777fc7d 100644
--- a/drivers/crypto/fsl/jr.c
+++ b/drivers/crypto/fsl/jr.c
@@ -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 */
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint
2017-04-15 14:37 [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint Heinrich Schuchardt
@ 2017-04-15 16:46 ` York Sun
2017-04-16 19:34 ` Simon Glass
2017-04-19 13:04 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: York Sun @ 2017-04-15 16:46 UTC (permalink / raw)
To: u-boot
On 04/15/2017 07:38 AM, Heinrich Schuchardt wrote:
> '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>
> ---
> drivers/crypto/fsl/jr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c
> index 1b882291e4..c33777fc7d 100644
> --- a/drivers/crypto/fsl/jr.c
> +++ b/drivers/crypto/fsl/jr.c
> @@ -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 */
>
Reviewed-by: York Sun <york.sun@nxp.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint
2017-04-15 14:37 [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint Heinrich Schuchardt
2017-04-15 16:46 ` York Sun
@ 2017-04-16 19:34 ` Simon Glass
2017-04-19 13:04 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2017-04-16 19:34 UTC (permalink / raw)
To: u-boot
On 15 April 2017 at 08:37, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> '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>
> ---
> drivers/crypto/fsl/jr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] drivers/crypto/fsl: remove redundant logical contraint
2017-04-15 14:37 [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint Heinrich Schuchardt
2017-04-15 16:46 ` York Sun
2017-04-16 19:34 ` Simon Glass
@ 2017-04-19 13:04 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2017-04-19 13:04 UTC (permalink / raw)
To: u-boot
On Sat, Apr 15, 2017 at 04:37:54PM +0200, xypron.glpk at gmx.de wrote:
> '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>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170419/a4e60feb/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-19 13:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15 14:37 [U-Boot] [PATCH] drivers/crypto/fsl: remove redundant logical contraint Heinrich Schuchardt
2017-04-15 16:46 ` York Sun
2017-04-16 19:34 ` Simon Glass
2017-04-19 13:04 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.