crypto: caam - pass key buffers with typesafe pointers
authorArnd Bergmann <arnd@arndb.de>
Wed, 30 Nov 2016 21:01:59 +0000 (22:01 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 1 Dec 2016 13:06:40 +0000 (21:06 +0800)
commit9c0bc511e93cc7693f0147274edfb719f221b8c1
tree0fb67880961ab47671dbaa64a9efc9b54f49ca9d
parent0be8a270b3f4af358549b8176c25be6972d86b35
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>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_desc.c
drivers/crypto/caam/desc_constr.h