Skip to content

Commit e6a67ad

Browse files
Chen GangMartin Schwidefsky
authored andcommitted
s390/crypto: remove 'const' to avoid compiler warnings
In aes_encrypt() and aes_decrypt(), need let 'sctx->key' be modified, so remove 'const' for it. The related warnings: CC [M] arch/s390/crypto/aes_s390.o arch/s390/crypto/aes_s390.c: In function 'aes_encrypt': arch/s390/crypto/aes_s390.c:146:37: warning: passing argument 2 of 'crypt_s390_km' discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers] crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in, ^ ... In file included from arch/s390/crypto/aes_s390.c:29:0: arch/s390/crypto/crypt_s390.h:154:19: note: expected 'void *' but argument is of type 'const u8 (*)[32] {aka const unsigned char (*)[32]}' static inline int crypt_s390_km(long func, void *param, ^ Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 91c0837 commit e6a67ad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/s390/crypto/aes_s390.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
134134

135135
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
136136
{
137-
const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
137+
struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
138138

139139
if (unlikely(need_fallback(sctx->key_len))) {
140140
crypto_cipher_encrypt_one(sctx->fallback.cip, out, in);
@@ -159,7 +159,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
159159

160160
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
161161
{
162-
const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
162+
struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
163163

164164
if (unlikely(need_fallback(sctx->key_len))) {
165165
crypto_cipher_decrypt_one(sctx->fallback.cip, out, in);

0 commit comments

Comments
 (0)