Skip to contentSkip to conversation

crypto: qat - use acomp_tfm_ctx()

PATCH In review Giovanni Cabiddu 2 participants 2 messages Mar 24 – Apr 3

Subsystems (2)
lore
Share & tools
lore

Giovanni Cabiddu

author maintainer
#0 lore raw

PATCH 1/1 crypto: qat - use acomp_tfm_ctx()

Replace the usage of crypto_acomp_tfm() followed by crypto_tfm_ctx() with a single call to the equivalent acomp_tfm_ctx().

This does not introduce any functional changes.

---
 drivers/crypto/intel/qat/qat_common/qat_comp_algs.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/crypto/intel/qat/qat_common/qat_comp_algs.c +3 -5
index 8b123472b71c..1265177e3a89 100644
@@ -130,8 +130,8 @@ void qat_comp_alg_callback(void *resp)
 
 static int qat_comp_alg_init_tfm(struct crypto_acomp *acomp_tfm)
 {
+	struct qat_compression_ctx *ctx = acomp_tfm_ctx(acomp_tfm);
 	struct crypto_tfm *tfm = crypto_acomp_tfm(acomp_tfm);
-	struct qat_compression_ctx *ctx = crypto_tfm_ctx(tfm);
 	struct qat_compression_instance *inst;
 	int node;
 
@@ -151,8 +151,7 @@ static int qat_comp_alg_init_tfm(struct crypto_acomp *acomp_tfm)
 
 static void qat_comp_alg_exit_tfm(struct crypto_acomp *acomp_tfm)
 {
-	struct crypto_tfm *tfm = crypto_acomp_tfm(acomp_tfm);
-	struct qat_compression_ctx *ctx = crypto_tfm_ctx(tfm);
+	struct qat_compression_ctx *ctx = acomp_tfm_ctx(acomp_tfm);
 
 	qat_compression_put_instance(ctx->inst);
 	memset(ctx, 0, sizeof(*ctx));
@@ -164,8 +163,7 @@ static int qat_comp_alg_compress_decompress(struct acomp_req *areq, enum directi
 {
 	struct qat_compression_req *qat_req = acomp_request_ctx(areq);
 	struct crypto_acomp *acomp_tfm = crypto_acomp_reqtfm(areq);
-	struct crypto_tfm *tfm = crypto_acomp_tfm(acomp_tfm);
-	struct qat_compression_ctx *ctx = crypto_tfm_ctx(tfm);
+	struct qat_compression_ctx *ctx = acomp_tfm_ctx(acomp_tfm);
 	struct qat_compression_instance *inst = ctx->inst;
 	gfp_t f = qat_algs_alloc_flags(&areq->base);
 	struct qat_sgl_to_bufl_params params = {0};

base-commit: 91adbdbe829e8de435e24460960f434ce5a49611

Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 11 lines · Giovanni Cabiddu

Replace the usage of crypto_acomp_tfm() followed by crypto_tfm_ctx() with a single call to the equivalent acomp_tfm_ctx().

This does not introduce any functional changes.

---
 drivers/crypto/intel/qat/qat_common/qat_comp_algs.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt