Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204348
b: refs/heads/master
c: 83f619f
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and Herbert Xu committed Jul 14, 2010
1 parent e973d9f commit 36ddfe5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33e54450683c5e970ac007489d7921ba792d093c
refs/heads/master: 83f619f3c8abb82cac9158cf23c656ec5c184607
18 changes: 6 additions & 12 deletions trunk/crypto/pcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
aead_request_set_assoc(creq, req->assoc, req->assoclen);

err = pcrypt_do_parallel(padata, &ctx->cb_cpu, pcrypt_enc_padata);
if (err)
return err;
else
err = crypto_aead_encrypt(creq);
if (!err)
return -EINPROGRESS;

return err;
}
Expand Down Expand Up @@ -187,10 +185,8 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
aead_request_set_assoc(creq, req->assoc, req->assoclen);

err = pcrypt_do_parallel(padata, &ctx->cb_cpu, pcrypt_dec_padata);
if (err)
return err;
else
err = crypto_aead_decrypt(creq);
if (!err)
return -EINPROGRESS;

return err;
}
Expand Down Expand Up @@ -233,10 +229,8 @@ static int pcrypt_aead_givencrypt(struct aead_givcrypt_request *req)
aead_givcrypt_set_giv(creq, req->giv, req->seq);

err = pcrypt_do_parallel(padata, &ctx->cb_cpu, pcrypt_enc_padata);
if (err)
return err;
else
err = crypto_aead_givencrypt(creq);
if (!err)
return -EINPROGRESS;

return err;
}
Expand Down
11 changes: 5 additions & 6 deletions trunk/kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,21 @@ int padata_do_parallel(struct padata_instance *pinst,

pd = rcu_dereference(pinst->pd);

err = 0;
err = -EINVAL;
if (!(pinst->flags & PADATA_INIT))
goto out;

if (!cpumask_test_cpu(cb_cpu, pd->cpumask))
goto out;

err = -EBUSY;
if ((pinst->flags & PADATA_RESET))
goto out;

if (atomic_read(&pd->refcnt) >= MAX_OBJ_NUM)
goto out;

err = -EINVAL;
if (!cpumask_test_cpu(cb_cpu, pd->cpumask))
goto out;

err = -EINPROGRESS;
err = 0;
atomic_inc(&pd->refcnt);
padata->pd = pd;
padata->cb_cpu = cb_cpu;
Expand Down

0 comments on commit 36ddfe5

Please sign in to comment.