Commit c5e07031 authored by Corentin Labbe's avatar Corentin Labbe Committed by Herbert Xu

crypto: ixp4xx - Correct functions alignment

This patch fixes all alignment issues reported by checkpatch.
Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ffb017e9
...@@ -354,8 +354,8 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt) ...@@ -354,8 +354,8 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt)
int decryptlen = req->assoclen + req->cryptlen - authsize; int decryptlen = req->assoclen + req->cryptlen - authsize;
if (req_ctx->encrypt) { if (req_ctx->encrypt) {
scatterwalk_map_and_copy(req_ctx->hmac_virt, scatterwalk_map_and_copy(req_ctx->hmac_virt, req->dst,
req->dst, decryptlen, authsize, 1); decryptlen, authsize, 1);
} }
dma_pool_free(buffer_pool, req_ctx->hmac_virt, crypt->icv_rev_aes); dma_pool_free(buffer_pool, req_ctx->hmac_virt, crypt->icv_rev_aes);
} }
...@@ -494,14 +494,13 @@ static int init_ixp_crypto(struct device *dev) ...@@ -494,14 +494,13 @@ static int init_ixp_crypto(struct device *dev)
* so assure it is large enough * so assure it is large enough
*/ */
BUILD_BUG_ON(SHA1_DIGEST_SIZE > sizeof(struct buffer_desc)); BUILD_BUG_ON(SHA1_DIGEST_SIZE > sizeof(struct buffer_desc));
buffer_pool = dma_pool_create("buffer", dev, buffer_pool = dma_pool_create("buffer", dev, sizeof(struct buffer_desc),
sizeof(struct buffer_desc), 32, 0); 32, 0);
ret = -ENOMEM; ret = -ENOMEM;
if (!buffer_pool) if (!buffer_pool)
goto err; goto err;
ctx_pool = dma_pool_create("context", dev, ctx_pool = dma_pool_create("context", dev, NPE_CTX_LEN, 16, 0);
NPE_CTX_LEN, 16, 0);
if (!ctx_pool) if (!ctx_pool)
goto err; goto err;
...@@ -546,8 +545,7 @@ static void release_ixp_crypto(struct device *dev) ...@@ -546,8 +545,7 @@ static void release_ixp_crypto(struct device *dev)
npe_release(npe_c); npe_release(npe_c);
if (crypt_virt) if (crypt_virt)
dma_free_coherent(dev, dma_free_coherent(dev, NPE_QLEN * sizeof(struct crypt_ctl),
NPE_QLEN * sizeof(struct crypt_ctl),
crypt_virt, crypt_phys); crypt_virt, crypt_phys);
} }
...@@ -641,7 +639,8 @@ static void exit_tfm_aead(struct crypto_aead *tfm) ...@@ -641,7 +639,8 @@ static void exit_tfm_aead(struct crypto_aead *tfm)
} }
static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target,
int init_len, u32 ctx_addr, const u8 *key, int key_len) int init_len, u32 ctx_addr, const u8 *key,
int key_len)
{ {
struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
struct crypt_ctl *crypt; struct crypt_ctl *crypt;
...@@ -770,8 +769,8 @@ static int gen_rev_aes_key(struct crypto_tfm *tfm) ...@@ -770,8 +769,8 @@ static int gen_rev_aes_key(struct crypto_tfm *tfm)
return 0; return 0;
} }
static int setup_cipher(struct crypto_tfm *tfm, int encrypt, static int setup_cipher(struct crypto_tfm *tfm, int encrypt, const u8 *key,
const u8 *key, int key_len) int key_len)
{ {
u8 *cinfo; u8 *cinfo;
u32 cipher_cfg; u32 cipher_cfg;
...@@ -791,9 +790,15 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt, ...@@ -791,9 +790,15 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt,
} }
if (cipher_cfg & MOD_AES) { if (cipher_cfg & MOD_AES) {
switch (key_len) { switch (key_len) {
case 16: keylen_cfg = MOD_AES128; break; case 16:
case 24: keylen_cfg = MOD_AES192; break; keylen_cfg = MOD_AES128;
case 32: keylen_cfg = MOD_AES256; break; break;
case 24:
keylen_cfg = MOD_AES192;
break;
case 32:
keylen_cfg = MOD_AES256;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -988,8 +993,8 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) ...@@ -988,8 +993,8 @@ static int ablk_perform(struct skcipher_request *req, int encrypt)
req_ctx->dst = NULL; req_ctx->dst = NULL;
} }
req_ctx->src = NULL; req_ctx->src = NULL;
if (!chainup_buffers(dev, req->src, nbytes, &src_hook, if (!chainup_buffers(dev, req->src, nbytes, &src_hook, flags,
flags, src_direction)) src_direction))
goto free_buf_src; goto free_buf_src;
req_ctx->src = src_hook.next; req_ctx->src = src_hook.next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment