Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: xilinx - Remove union from zynqmp_aead_drv_ctx

"alg" in zynqmp_aead_drv_ctx is single field union variable.
Remove unnecessary alg union from structure.

Signed-off-by: Harsh Jain <h.jain@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Harsh Jain and committed by
Herbert Xu
c7a768f5 c15291e2

+11 -13
+11 -13
drivers/crypto/xilinx/zynqmp-aes-gcm.c
··· 43 43 }; 44 44 45 45 struct zynqmp_aead_drv_ctx { 46 - union { 47 - struct aead_engine_alg aead; 48 - } alg; 46 + struct aead_engine_alg aead; 49 47 struct device *dev; 50 48 struct crypto_engine *engine; 51 49 }; ··· 287 289 struct zynqmp_aead_req_ctx *rq_ctx = aead_request_ctx(req); 288 290 289 291 rq_ctx->op = ZYNQMP_AES_ENCRYPT; 290 - drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, alg.aead.base); 292 + drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, aead.base); 291 293 292 294 return crypto_transfer_aead_request_to_engine(drv_ctx->engine, req); 293 295 } ··· 300 302 struct zynqmp_aead_req_ctx *rq_ctx = aead_request_ctx(req); 301 303 302 304 rq_ctx->op = ZYNQMP_AES_DECRYPT; 303 - drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, alg.aead.base); 305 + drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, aead.base); 304 306 305 307 return crypto_transfer_aead_request_to_engine(drv_ctx->engine, req); 306 308 } ··· 313 315 struct zynqmp_aead_drv_ctx *drv_ctx; 314 316 struct aead_alg *alg = crypto_aead_alg(aead); 315 317 316 - drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, alg.aead.base); 318 + drv_ctx = container_of(alg, struct zynqmp_aead_drv_ctx, aead.base); 317 319 tfm_ctx->dev = drv_ctx->dev; 318 320 319 - tfm_ctx->fbk_cipher = crypto_alloc_aead(drv_ctx->alg.aead.base.base.cra_name, 321 + tfm_ctx->fbk_cipher = crypto_alloc_aead(drv_ctx->aead.base.base.cra_name, 320 322 0, 321 323 CRYPTO_ALG_NEED_FALLBACK); 322 324 323 325 if (IS_ERR(tfm_ctx->fbk_cipher)) { 324 326 pr_err("%s() Error: failed to allocate fallback for %s\n", 325 - __func__, drv_ctx->alg.aead.base.base.cra_name); 327 + __func__, drv_ctx->aead.base.base.cra_name); 326 328 return PTR_ERR(tfm_ctx->fbk_cipher); 327 329 } 328 330 ··· 347 349 } 348 350 349 351 static struct zynqmp_aead_drv_ctx aes_drv_ctx = { 350 - .alg.aead.base = { 352 + .aead.base = { 351 353 .setkey = zynqmp_aes_aead_setkey, 352 354 .setauthsize = zynqmp_aes_aead_setauthsize, 353 355 .encrypt = zynqmp_aes_aead_encrypt, ··· 370 372 .cra_module = THIS_MODULE, 371 373 } 372 374 }, 373 - .alg.aead.op = { 375 + .aead.op = { 374 376 .do_one_request = zynqmp_handle_aes_req, 375 377 }, 376 378 }; ··· 405 407 goto err_engine; 406 408 } 407 409 408 - err = crypto_engine_register_aead(&aes_drv_ctx.alg.aead); 410 + err = crypto_engine_register_aead(&aes_drv_ctx.aead); 409 411 if (err < 0) { 410 412 dev_err(dev, "Failed to register AEAD alg.\n"); 411 413 goto err_aead; ··· 413 415 return 0; 414 416 415 417 err_aead: 416 - crypto_engine_unregister_aead(&aes_drv_ctx.alg.aead); 418 + crypto_engine_unregister_aead(&aes_drv_ctx.aead); 417 419 418 420 err_engine: 419 421 if (aes_drv_ctx.engine) ··· 425 427 static void zynqmp_aes_aead_remove(struct platform_device *pdev) 426 428 { 427 429 crypto_engine_exit(aes_drv_ctx.engine); 428 - crypto_engine_unregister_aead(&aes_drv_ctx.alg.aead); 430 + crypto_engine_unregister_aead(&aes_drv_ctx.aead); 429 431 } 430 432 431 433 static const struct of_device_id zynqmp_aes_dt_ids[] = {