qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

crypto: Redundant type conversion for AES_KEY pointer

We can delete the redundant type conversion if
we set the the AES_KEY parameter with 'const' in
qcrypto_cipher_aes_ecb_(en|de)crypt() function.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

authored by

Chen Qun and committed by
Daniel P. Berrangé
ccebb5f3 861c50bf

+4 -6
+4 -6
crypto/cipher-builtin.c
··· 74 74 } 75 75 76 76 77 - static void qcrypto_cipher_aes_ecb_encrypt(AES_KEY *key, 77 + static void qcrypto_cipher_aes_ecb_encrypt(const AES_KEY *key, 78 78 const void *in, 79 79 void *out, 80 80 size_t len) ··· 100 100 } 101 101 102 102 103 - static void qcrypto_cipher_aes_ecb_decrypt(AES_KEY *key, 103 + static void qcrypto_cipher_aes_ecb_decrypt(const AES_KEY *key, 104 104 const void *in, 105 105 void *out, 106 106 size_t len) ··· 133 133 { 134 134 const QCryptoCipherBuiltinAESContext *aesctx = ctx; 135 135 136 - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc, 137 - src, dst, length); 136 + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length); 138 137 } 139 138 140 139 ··· 145 144 { 146 145 const QCryptoCipherBuiltinAESContext *aesctx = ctx; 147 146 148 - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec, 149 - src, dst, length); 147 + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length); 150 148 } 151 149 152 150