aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2009-03-29 03:53:59 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-06-02 00:04:28 -0400
commit19bbbc635523703ece28409e59694d5b512b819e (patch)
tree2788e7c2439c0cb5e6bfb8a638a53fb1e2964c23 /drivers/crypto
parente938e4656b3ee32e046ee8293411a07be9d72eb8 (diff)
crypto: talitos - containerof related codingstyle
no functional changes. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/talitos.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index a073e6b6a3c8..1cc1c411e551 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -841,13 +841,14 @@ static void ipsec_esp_encrypt_done(struct device *dev,
841 int err) 841 int err)
842{ 842{
843 struct aead_request *areq = context; 843 struct aead_request *areq = context;
844 struct talitos_edesc *edesc =
845 container_of(desc, struct talitos_edesc, desc);
846 struct crypto_aead *authenc = crypto_aead_reqtfm(areq); 844 struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
847 struct talitos_ctx *ctx = crypto_aead_ctx(authenc); 845 struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
846 struct talitos_edesc *edesc;
848 struct scatterlist *sg; 847 struct scatterlist *sg;
849 void *icvdata; 848 void *icvdata;
850 849
850 edesc = container_of(desc, struct talitos_edesc, desc);
851
851 ipsec_esp_unmap(dev, edesc, areq); 852 ipsec_esp_unmap(dev, edesc, areq);
852 853
853 /* copy the generated ICV to dst */ 854 /* copy the generated ICV to dst */
@@ -869,13 +870,14 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
869 void *context, int err) 870 void *context, int err)
870{ 871{
871 struct aead_request *req = context; 872 struct aead_request *req = context;
872 struct talitos_edesc *edesc =
873 container_of(desc, struct talitos_edesc, desc);
874 struct crypto_aead *authenc = crypto_aead_reqtfm(req); 873 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
875 struct talitos_ctx *ctx = crypto_aead_ctx(authenc); 874 struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
875 struct talitos_edesc *edesc;
876 struct scatterlist *sg; 876 struct scatterlist *sg;
877 void *icvdata; 877 void *icvdata;
878 878
879 edesc = container_of(desc, struct talitos_edesc, desc);
880
879 ipsec_esp_unmap(dev, edesc, req); 881 ipsec_esp_unmap(dev, edesc, req);
880 882
881 if (!err) { 883 if (!err) {
@@ -901,8 +903,9 @@ static void ipsec_esp_decrypt_hwauth_done(struct device *dev,
901 void *context, int err) 903 void *context, int err)
902{ 904{
903 struct aead_request *req = context; 905 struct aead_request *req = context;
904 struct talitos_edesc *edesc = 906 struct talitos_edesc *edesc;
905 container_of(desc, struct talitos_edesc, desc); 907
908 edesc = container_of(desc, struct talitos_edesc, desc);
906 909
907 ipsec_esp_unmap(dev, edesc, req); 910 ipsec_esp_unmap(dev, edesc, req);
908 911
@@ -1308,8 +1311,9 @@ static void ablkcipher_done(struct device *dev,
1308 int err) 1311 int err)
1309{ 1312{
1310 struct ablkcipher_request *areq = context; 1313 struct ablkcipher_request *areq = context;
1311 struct talitos_edesc *edesc = 1314 struct talitos_edesc *edesc;
1312 container_of(desc, struct talitos_edesc, desc); 1315
1316 edesc = container_of(desc, struct talitos_edesc, desc);
1313 1317
1314 common_nonsnoop_unmap(dev, edesc, areq); 1318 common_nonsnoop_unmap(dev, edesc, areq);
1315 1319
@@ -1686,12 +1690,14 @@ struct talitos_crypto_alg {
1686static int talitos_cra_init(struct crypto_tfm *tfm) 1690static int talitos_cra_init(struct crypto_tfm *tfm)
1687{ 1691{
1688 struct crypto_alg *alg = tfm->__crt_alg; 1692 struct crypto_alg *alg = tfm->__crt_alg;
1689 struct talitos_crypto_alg *talitos_alg = 1693 struct talitos_crypto_alg *talitos_alg;
1690 container_of(alg, struct talitos_crypto_alg, crypto_alg);
1691 struct talitos_ctx *ctx = crypto_tfm_ctx(tfm); 1694 struct talitos_ctx *ctx = crypto_tfm_ctx(tfm);
1692 1695
1696 talitos_alg = container_of(alg, struct talitos_crypto_alg, crypto_alg);
1697
1693 /* update context with ptr to dev */ 1698 /* update context with ptr to dev */
1694 ctx->dev = talitos_alg->dev; 1699 ctx->dev = talitos_alg->dev;
1700
1695 /* copy descriptor header template value */ 1701 /* copy descriptor header template value */
1696 ctx->desc_hdr_template = talitos_alg->desc_hdr_template; 1702 ctx->desc_hdr_template = talitos_alg->desc_hdr_template;
1697 1703