]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 12 Nov 2020 20:07:02 +0000 (13:07 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:25:45 +0000 (14:25 +0100)
commit3b132f62fae896bc25837f460063599f3e77d4b3
treef0226f1d0f99a544d504c07f291d2b29afd1335e
parente1a296c0d312afbe3b4f2c63fa1d849b5b74dcaf
crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd

BugLink: https://bugs.launchpad.net/bugs/1910822
[ Upstream commit 5bdad829c31a09069fd508534f03c2ea1576ac75 ]

Clang warns:

drivers/crypto/amcc/crypto4xx_core.c:921:60: warning: operator '?:' has
lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]
                 (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/crypto/amcc/crypto4xx_core.c:921:60: note: place parentheses
around the '|' expression to silence this warning
                 (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
                                                                         ^
                                                                        )
drivers/crypto/amcc/crypto4xx_core.c:921:60: note: place parentheses
around the '?:' expression to evaluate it first
                 (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
                                                                         ^
                 (
1 warning generated.

It looks like this should have been a logical OR so that
PD_CTL_HASH_FINAL gets added to the w bitmask if crypto_tfm_alg_type
is either CRYPTO_ALG_TYPE_AHASH or CRYPTO_ALG_TYPE_AEAD. Change the
operator so that everything works properly.

Fixes: 4b5b79998af6 ("crypto: crypto4xx - fix stalls under heavy load")
Link: https://github.com/ClangBuiltLinux/linux/issues/1198
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/crypto/amcc/crypto4xx_core.c