WSL2-Linux-Kernel/drivers/crypto/ccree
Nathan Chancellor 18e732b803 crypto: ccree - avoid implicit enum conversion
Clang warns when one enumerated type is implicitly converted to another
and this happens in several locations in this driver, ultimately related
to the set_cipher_{mode,config0} functions. set_cipher_mode expects a mode
of type drv_cipher_mode and set_cipher_config0 expects a mode of type
drv_crypto_direction.

drivers/crypto/ccree/cc_ivgen.c:58:35: warning: implicit conversion from
enumeration type 'enum cc_desc_direction' to different enumeration type
'enum drv_crypto_direction' [-Wenum-conversion]
        set_cipher_config0(&iv_seq[idx], DESC_DIRECTION_ENCRYPT_ENCRYPT);

drivers/crypto/ccree/cc_hash.c:99:28: warning: implicit conversion from
enumeration type 'enum cc_hash_conf_pad' to different enumeration type
'enum drv_crypto_direction' [-Wenum-conversion]
                set_cipher_config0(desc, HASH_DIGEST_RESULT_LITTLE_ENDIAN);

drivers/crypto/ccree/cc_aead.c:1643:30: warning: implicit conversion
from enumeration type 'enum drv_hash_hw_mode' to different enumeration
type 'enum drv_cipher_mode' [-Wenum-conversion]
        set_cipher_mode(&desc[idx], DRV_HASH_HW_GHASH);

Since this fundamentally isn't a problem because these values just
represent simple integers for a shift operation, make it clear to Clang
that this is okay by making the mode parameter in both functions an int.

Link: https://github.com/ClangBuiltLinux/linux/issues/46
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-10-17 14:16:18 +08:00
..
Makefile crypto: ccree - add FIPS support 2018-02-15 23:26:42 +08:00
cc_aead.c crypto: ccree - drop useless type flag during reg 2018-08-03 18:06:05 +08:00
cc_aead.h crypto: ccree - add AEAD support 2018-02-15 23:26:42 +08:00
cc_buffer_mgr.c crypto: ccree - remove cipher ivgen left overs 2018-08-03 18:06:05 +08:00
cc_buffer_mgr.h crypto: ccree - add AEAD support 2018-02-15 23:26:42 +08:00
cc_cipher.c crypto: ccree - allow bigger than sector XTS op 2018-08-03 18:06:05 +08:00
cc_cipher.h crypto: ccree - remove cipher ivgen left overs 2018-08-03 18:06:05 +08:00
cc_crypto_ctx.h crypto: ccree - add support for older HW revs 2018-03-03 00:03:16 +08:00
cc_debugfs.c crypto: ccree - correct host regs offset 2018-05-31 00:13:49 +08:00
cc_debugfs.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_driver.c crypto: ccree - rate limit debug print 2018-07-09 00:33:36 +08:00
cc_driver.h crypto: ccree - drop useless type flag during reg 2018-08-03 18:06:05 +08:00
cc_fips.c crypto: ccree - add support for older HW revs 2018-03-03 00:03:16 +08:00
cc_fips.h crypto: ccree - add FIPS support 2018-02-15 23:26:42 +08:00
cc_hash.c crypto: ccree - fix finup 2018-07-09 00:33:35 +08:00
cc_hash.h crypto: ccree - add support for older HW revs 2018-03-03 00:03:16 +08:00
cc_host_regs.h crypto: ccree - correct host regs offset 2018-05-31 00:13:49 +08:00
cc_hw_queue_defs.h crypto: ccree - avoid implicit enum conversion 2018-10-17 14:16:18 +08:00
cc_ivgen.c crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_ivgen.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_kernel_regs.h crypto: ccree - add support for older HW revs 2018-03-03 00:03:16 +08:00
cc_lli_defs.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_pm.c crypto: ccree - add ahash support 2018-02-15 23:26:41 +08:00
cc_pm.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_request_mgr.c crypto: ccree - replace memset+kfree with kzfree 2018-03-03 00:03:16 +08:00
cc_request_mgr.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00
cc_sram_mgr.c crypto: ccree - add support for older HW revs 2018-03-03 00:03:16 +08:00
cc_sram_mgr.h crypto: ccree - introduce CryptoCell driver 2018-02-15 23:26:40 +08:00