Skip to content

Commit

Permalink
crypto: Resolve shadow warnings
Browse files Browse the repository at this point in the history
Change formal parameters to not clash with global names to
eliminate many W=2 warnings.

Signed-off-by: Mark Rustad <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
mdrustad authored and herbertx committed Aug 1, 2014
1 parent 4839ddc commit 3e3dc25
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 81 deletions.
12 changes: 6 additions & 6 deletions crypto/cryptd.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ static void cryptd_blkcipher_decrypt(struct crypto_async_request *req, int err)
}

static int cryptd_blkcipher_enqueue(struct ablkcipher_request *req,
crypto_completion_t complete)
crypto_completion_t compl)
{
struct cryptd_blkcipher_request_ctx *rctx = ablkcipher_request_ctx(req);
struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
struct cryptd_queue *queue;

queue = cryptd_get_queue(crypto_ablkcipher_tfm(tfm));
rctx->complete = req->base.complete;
req->base.complete = complete;
req->base.complete = compl;

return cryptd_enqueue_request(queue, &req->base);
}
Expand Down Expand Up @@ -414,15 +414,15 @@ static int cryptd_hash_setkey(struct crypto_ahash *parent,
}

static int cryptd_hash_enqueue(struct ahash_request *req,
crypto_completion_t complete)
crypto_completion_t compl)
{
struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req);
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
struct cryptd_queue *queue =
cryptd_get_queue(crypto_ahash_tfm(tfm));

rctx->complete = req->base.complete;
req->base.complete = complete;
req->base.complete = compl;

return cryptd_enqueue_request(queue, &req->base);
}
Expand Down Expand Up @@ -667,14 +667,14 @@ static void cryptd_aead_decrypt(struct crypto_async_request *areq, int err)
}

static int cryptd_aead_enqueue(struct aead_request *req,
crypto_completion_t complete)
crypto_completion_t compl)
{
struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req);
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
struct cryptd_queue *queue = cryptd_get_queue(crypto_aead_tfm(tfm));

rctx->complete = req->base.complete;
req->base.complete = complete;
req->base.complete = compl;
return cryptd_enqueue_request(queue, &req->base);
}

Expand Down
8 changes: 4 additions & 4 deletions crypto/eseqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
struct eseqiv_ctx *ctx = crypto_ablkcipher_ctx(geniv);
struct eseqiv_request_ctx *reqctx = skcipher_givcrypt_reqctx(req);
struct ablkcipher_request *subreq;
crypto_completion_t complete;
crypto_completion_t compl;
void *data;
struct scatterlist *osrc, *odst;
struct scatterlist *dst;
Expand All @@ -86,7 +86,7 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
ablkcipher_request_set_tfm(subreq, skcipher_geniv_cipher(geniv));

giv = req->giv;
complete = req->creq.base.complete;
compl = req->creq.base.complete;
data = req->creq.base.data;

osrc = req->creq.src;
Expand All @@ -101,11 +101,11 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
if (vsrc != giv + ivsize && vdst != giv + ivsize) {
giv = PTR_ALIGN((u8 *)reqctx->tail,
crypto_ablkcipher_alignmask(geniv) + 1);
complete = eseqiv_complete;
compl = eseqiv_complete;
data = req;
}

ablkcipher_request_set_callback(subreq, req->creq.base.flags, complete,
ablkcipher_request_set_callback(subreq, req->creq.base.flags, compl,
data);

sg_init_table(reqctx->src, 2);
Expand Down
30 changes: 15 additions & 15 deletions crypto/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ static void gcm_hash_final_done(struct crypto_async_request *areq, int err);

static int gcm_hash_update(struct aead_request *req,
struct crypto_gcm_req_priv_ctx *pctx,
crypto_completion_t complete,
crypto_completion_t compl,
struct scatterlist *src,
unsigned int len)
{
struct ahash_request *ahreq = &pctx->u.ahreq;

ahash_request_set_callback(ahreq, aead_request_flags(req),
complete, req);
compl, req);
ahash_request_set_crypt(ahreq, src, NULL, len);

return crypto_ahash_update(ahreq);
Expand All @@ -244,12 +244,12 @@ static int gcm_hash_update(struct aead_request *req,
static int gcm_hash_remain(struct aead_request *req,
struct crypto_gcm_req_priv_ctx *pctx,
unsigned int remain,
crypto_completion_t complete)
crypto_completion_t compl)
{
struct ahash_request *ahreq = &pctx->u.ahreq;

ahash_request_set_callback(ahreq, aead_request_flags(req),
complete, req);
compl, req);
sg_init_one(pctx->src, gcm_zeroes, remain);
ahash_request_set_crypt(ahreq, pctx->src, NULL, remain);

Expand Down Expand Up @@ -375,14 +375,14 @@ static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err)
{
struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
crypto_completion_t complete;
crypto_completion_t compl;
unsigned int remain = 0;

if (!err && gctx->cryptlen) {
remain = gcm_remain(gctx->cryptlen);
complete = remain ? gcm_hash_crypt_done :
compl = remain ? gcm_hash_crypt_done :
gcm_hash_crypt_remain_done;
err = gcm_hash_update(req, pctx, complete,
err = gcm_hash_update(req, pctx, compl,
gctx->src, gctx->cryptlen);
if (err == -EINPROGRESS || err == -EBUSY)
return;
Expand Down Expand Up @@ -429,14 +429,14 @@ static void gcm_hash_assoc_done(struct crypto_async_request *areq, int err)
static void __gcm_hash_init_done(struct aead_request *req, int err)
{
struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
crypto_completion_t complete;
crypto_completion_t compl;
unsigned int remain = 0;

if (!err && req->assoclen) {
remain = gcm_remain(req->assoclen);
complete = remain ? gcm_hash_assoc_done :
compl = remain ? gcm_hash_assoc_done :
gcm_hash_assoc_remain_done;
err = gcm_hash_update(req, pctx, complete,
err = gcm_hash_update(req, pctx, compl,
req->assoc, req->assoclen);
if (err == -EINPROGRESS || err == -EBUSY)
return;
Expand All @@ -462,7 +462,7 @@ static int gcm_hash(struct aead_request *req,
struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
unsigned int remain;
crypto_completion_t complete;
crypto_completion_t compl;
int err;

ahash_request_set_tfm(ahreq, ctx->ghash);
Expand All @@ -473,8 +473,8 @@ static int gcm_hash(struct aead_request *req,
if (err)
return err;
remain = gcm_remain(req->assoclen);
complete = remain ? gcm_hash_assoc_done : gcm_hash_assoc_remain_done;
err = gcm_hash_update(req, pctx, complete, req->assoc, req->assoclen);
compl = remain ? gcm_hash_assoc_done : gcm_hash_assoc_remain_done;
err = gcm_hash_update(req, pctx, compl, req->assoc, req->assoclen);
if (err)
return err;
if (remain) {
Expand All @@ -484,8 +484,8 @@ static int gcm_hash(struct aead_request *req,
return err;
}
remain = gcm_remain(gctx->cryptlen);
complete = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done;
err = gcm_hash_update(req, pctx, complete, gctx->src, gctx->cryptlen);
compl = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done;
err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen);
if (err)
return err;
if (remain) {
Expand Down
16 changes: 8 additions & 8 deletions crypto/seqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ static int seqiv_givencrypt(struct skcipher_givcrypt_request *req)
struct crypto_ablkcipher *geniv = skcipher_givcrypt_reqtfm(req);
struct seqiv_ctx *ctx = crypto_ablkcipher_ctx(geniv);
struct ablkcipher_request *subreq = skcipher_givcrypt_reqctx(req);
crypto_completion_t complete;
crypto_completion_t compl;
void *data;
u8 *info;
unsigned int ivsize;
int err;

ablkcipher_request_set_tfm(subreq, skcipher_geniv_cipher(geniv));

complete = req->creq.base.complete;
compl = req->creq.base.complete;
data = req->creq.base.data;
info = req->creq.info;

Expand All @@ -122,11 +122,11 @@ static int seqiv_givencrypt(struct skcipher_givcrypt_request *req)
if (!info)
return -ENOMEM;

complete = seqiv_complete;
compl = seqiv_complete;
data = req;
}

ablkcipher_request_set_callback(subreq, req->creq.base.flags, complete,
ablkcipher_request_set_callback(subreq, req->creq.base.flags, compl,
data);
ablkcipher_request_set_crypt(subreq, req->creq.src, req->creq.dst,
req->creq.nbytes, info);
Expand All @@ -146,15 +146,15 @@ static int seqiv_aead_givencrypt(struct aead_givcrypt_request *req)
struct seqiv_ctx *ctx = crypto_aead_ctx(geniv);
struct aead_request *areq = &req->areq;
struct aead_request *subreq = aead_givcrypt_reqctx(req);
crypto_completion_t complete;
crypto_completion_t compl;
void *data;
u8 *info;
unsigned int ivsize;
int err;

aead_request_set_tfm(subreq, aead_geniv_base(geniv));

complete = areq->base.complete;
compl = areq->base.complete;
data = areq->base.data;
info = areq->iv;

Expand All @@ -168,11 +168,11 @@ static int seqiv_aead_givencrypt(struct aead_givcrypt_request *req)
if (!info)
return -ENOMEM;

complete = seqiv_aead_complete;
compl = seqiv_aead_complete;
data = req;
}

aead_request_set_callback(subreq, areq->base.flags, complete, data);
aead_request_set_callback(subreq, areq->base.flags, compl, data);
aead_request_set_crypt(subreq, areq->src, areq->dst, areq->cryptlen,
info);
aead_request_set_assoc(subreq, areq->assoc, areq->assoclen);
Expand Down
Loading

0 comments on commit 3e3dc25

Please sign in to comment.