]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/crypto: remove 'const' to avoid compiler warnings
authorChen Gang <gang.chen@sunrus.com.cn>
Thu, 1 Jan 2015 14:56:02 +0000 (22:56 +0800)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 8 Jan 2015 09:02:53 +0000 (10:02 +0100)
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>
arch/s390/crypto/aes_s390.c

index 1f272b24fc0bf9393d44939ea2b225a84e36ea2a..5566ce80abdbf7c97bec630d480b583b324bf82d 100644 (file)
@@ -134,7 +134,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
 
 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
-       const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
+       struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
 
        if (unlikely(need_fallback(sctx->key_len))) {
                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)
 
 static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 {
-       const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
+       struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
 
        if (unlikely(need_fallback(sctx->key_len))) {
                crypto_cipher_decrypt_one(sctx->fallback.cip, out, in);