diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-01 04:03:09 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-02 14:37:53 +0200 |
commit | 4be0129ef170acbb259599293d28ee6e9c1848c5 (patch) | |
tree | 583920f27a212a43531403513c4d950270c5f015 /src/crypto/include | |
parent | 30b08000fadb23358e48b382afa2097339ee9bba (diff) |
global: change BUG_ON to WARN_ON
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/include')
-rw-r--r-- | src/crypto/include/zinc/blake2s.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/crypto/include/zinc/blake2s.h b/src/crypto/include/zinc/blake2s.h index 3dbe4b5..701a08b 100644 --- a/src/crypto/include/zinc/blake2s.h +++ b/src/crypto/include/zinc/blake2s.h @@ -8,6 +8,7 @@ #include <linux/types.h> #include <linux/kernel.h> +#include <asm/bug.h> enum blake2s_lengths { BLAKE2S_BLOCK_SIZE = 64, @@ -36,11 +37,9 @@ static inline void blake2s(u8 *out, const u8 *in, const u8 *key, { struct blake2s_state state; -#ifdef DEBUG - BUG_ON((!in && inlen > 0) || !out || !outlen || - outlen > BLAKE2S_HASH_SIZE || keylen > BLAKE2S_KEY_SIZE || - (!key && keylen)); -#endif + WARN_ON(IS_ENABLED(DEBUG) && ((!in && inlen > 0) || !out || !outlen || + outlen > BLAKE2S_HASH_SIZE || keylen > BLAKE2S_KEY_SIZE || + (!key && keylen))); if (keylen) blake2s_init_key(&state, outlen, key, keylen); |