diff --git a/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.c b/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.c index 0b06aadb17..8f2aed1509 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.c @@ -289,22 +289,22 @@ void CRYPTO_IRQHandler() { uint32_t intsts; - if ((intsts = PRNG_GET_INT_FLAG())) { + if ((intsts = PRNG_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_prng_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */ PRNG_CLR_INT_FLAG(); - } else if ((intsts = AES_GET_INT_FLAG())) { + } else if ((intsts = AES_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_aes_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */ AES_CLR_INT_FLAG(); - } else if ((intsts = TDES_GET_INT_FLAG())) { + } else if ((intsts = TDES_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_des_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */ TDES_CLR_INT_FLAG(); - } else if ((intsts = ECC_GET_INT_FLAG())) { + } else if ((intsts = ECC_GET_INT_FLAG()) != 0) { /* Check interrupt flags */ if (intsts & CRPT_INTSTS_ECCIF_Msk) { /* Done with OK */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.c index 5705558da8..72581362d7 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.c @@ -256,17 +256,17 @@ void CRYPTO_IRQHandler() { uint32_t intsts; - if ((intsts = PRNG_GET_INT_FLAG())) { + if ((intsts = PRNG_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_prng_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */ PRNG_CLR_INT_FLAG(); - } else if ((intsts = AES_GET_INT_FLAG())) { + } else if ((intsts = AES_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_aes_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */ AES_CLR_INT_FLAG(); - } else if ((intsts = TDES_GET_INT_FLAG())) { + } else if ((intsts = TDES_GET_INT_FLAG()) != 0) { /* Done with OK */ crypto_des_done |= CRYPTO_DONE_OK; /* Clear interrupt flag */