Commit 19bbbc63 authored by Kim Phillips's avatar Kim Phillips Committed by Herbert Xu

crypto: talitos - containerof related codingstyle

no functional changes.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e938e465
...@@ -841,13 +841,14 @@ static void ipsec_esp_encrypt_done(struct device *dev, ...@@ -841,13 +841,14 @@ static void ipsec_esp_encrypt_done(struct device *dev,
int err) int err)
{ {
struct aead_request *areq = context; struct aead_request *areq = context;
struct talitos_edesc *edesc =
container_of(desc, struct talitos_edesc, desc);
struct crypto_aead *authenc = crypto_aead_reqtfm(areq); struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
struct talitos_ctx *ctx = crypto_aead_ctx(authenc); struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
struct talitos_edesc *edesc;
struct scatterlist *sg; struct scatterlist *sg;
void *icvdata; void *icvdata;
edesc = container_of(desc, struct talitos_edesc, desc);
ipsec_esp_unmap(dev, edesc, areq); ipsec_esp_unmap(dev, edesc, areq);
/* copy the generated ICV to dst */ /* copy the generated ICV to dst */
...@@ -869,13 +870,14 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev, ...@@ -869,13 +870,14 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
void *context, int err) void *context, int err)
{ {
struct aead_request *req = context; struct aead_request *req = context;
struct talitos_edesc *edesc =
container_of(desc, struct talitos_edesc, desc);
struct crypto_aead *authenc = crypto_aead_reqtfm(req); struct crypto_aead *authenc = crypto_aead_reqtfm(req);
struct talitos_ctx *ctx = crypto_aead_ctx(authenc); struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
struct talitos_edesc *edesc;
struct scatterlist *sg; struct scatterlist *sg;
void *icvdata; void *icvdata;
edesc = container_of(desc, struct talitos_edesc, desc);
ipsec_esp_unmap(dev, edesc, req); ipsec_esp_unmap(dev, edesc, req);
if (!err) { if (!err) {
...@@ -901,8 +903,9 @@ static void ipsec_esp_decrypt_hwauth_done(struct device *dev, ...@@ -901,8 +903,9 @@ static void ipsec_esp_decrypt_hwauth_done(struct device *dev,
void *context, int err) void *context, int err)
{ {
struct aead_request *req = context; struct aead_request *req = context;
struct talitos_edesc *edesc = struct talitos_edesc *edesc;
container_of(desc, struct talitos_edesc, desc);
edesc = container_of(desc, struct talitos_edesc, desc);
ipsec_esp_unmap(dev, edesc, req); ipsec_esp_unmap(dev, edesc, req);
...@@ -1308,8 +1311,9 @@ static void ablkcipher_done(struct device *dev, ...@@ -1308,8 +1311,9 @@ static void ablkcipher_done(struct device *dev,
int err) int err)
{ {
struct ablkcipher_request *areq = context; struct ablkcipher_request *areq = context;
struct talitos_edesc *edesc = struct talitos_edesc *edesc;
container_of(desc, struct talitos_edesc, desc);
edesc = container_of(desc, struct talitos_edesc, desc);
common_nonsnoop_unmap(dev, edesc, areq); common_nonsnoop_unmap(dev, edesc, areq);
...@@ -1686,12 +1690,14 @@ struct talitos_crypto_alg { ...@@ -1686,12 +1690,14 @@ struct talitos_crypto_alg {
static int talitos_cra_init(struct crypto_tfm *tfm) static int talitos_cra_init(struct crypto_tfm *tfm)
{ {
struct crypto_alg *alg = tfm->__crt_alg; struct crypto_alg *alg = tfm->__crt_alg;
struct talitos_crypto_alg *talitos_alg = struct talitos_crypto_alg *talitos_alg;
container_of(alg, struct talitos_crypto_alg, crypto_alg);
struct talitos_ctx *ctx = crypto_tfm_ctx(tfm); struct talitos_ctx *ctx = crypto_tfm_ctx(tfm);
talitos_alg = container_of(alg, struct talitos_crypto_alg, crypto_alg);
/* update context with ptr to dev */ /* update context with ptr to dev */
ctx->dev = talitos_alg->dev; ctx->dev = talitos_alg->dev;
/* copy descriptor header template value */ /* copy descriptor header template value */
ctx->desc_hdr_template = talitos_alg->desc_hdr_template; ctx->desc_hdr_template = talitos_alg->desc_hdr_template;
......
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