summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/desc_constr.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-11-30 22:01:59 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2016-12-01 21:06:40 +0800
commit9c0bc511e93cc7693f0147274edfb719f221b8c1 (patch)
tree0fb67880961ab47671dbaa64a9efc9b54f49ca9d /drivers/crypto/caam/desc_constr.h
parent0be8a270b3f4af358549b8176c25be6972d86b35 (diff)
downloadlinux-stable-9c0bc511e93cc7693f0147274edfb719f221b8c1.tar.gz
linux-stable-9c0bc511e93cc7693f0147274edfb719f221b8c1.tar.bz2
linux-stable-9c0bc511e93cc7693f0147274edfb719f221b8c1.zip
crypto: caam - pass key buffers with typesafe pointers
The 'key' field is defined as a 'u64' and used for two different pieces of information: either to store a pointer or a dma_addr_t. The former leads to a build error on 32-bit machines: drivers/crypto/caam/caamalg_desc.c: In function 'cnstr_shdsc_aead_null_encap': drivers/crypto/caam/caamalg_desc.c:67:27: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] drivers/crypto/caam/caamalg_desc.c: In function 'cnstr_shdsc_aead_null_decap': drivers/crypto/caam/caamalg_desc.c:143:27: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] Using a union to provide correct types gets rid of the warnings and as well as a couple of redundant casts. Fixes: db57656b0072 ("crypto: caam - group algorithm related params") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/desc_constr.h')
-rw-r--r--drivers/crypto/caam/desc_constr.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h
index fa70c0d79c40..b9c8d98ef826 100644
--- a/drivers/crypto/caam/desc_constr.h
+++ b/drivers/crypto/caam/desc_constr.h
@@ -446,7 +446,10 @@ struct alginfo {
u32 algtype;
unsigned int keylen;
unsigned int keylen_pad;
- u64 key;
+ union {
+ dma_addr_t key_dma;
+ void *key_virt;
+ };
bool key_inline;
};