[PATCH 13/15] crypto: xilinx: cleanup: Remove un-necessary typecast operation
Harsh Jain
h.jain at amd.com
Wed Oct 29 03:21:56 PDT 2025
Return type of crypto_tfm_ctx() is void *. Remove explicit type cast.
Signed-off-by: Harsh Jain <h.jain at amd.com>
---
drivers/crypto/xilinx/zynqmp-aes-gcm.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
index b0ebb4971608..6bc5dec94884 100644
--- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c
+++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
@@ -267,8 +267,7 @@ static int xilinx_aes_aead_setauthsize(struct crypto_aead *aead,
unsigned int authsize)
{
struct crypto_tfm *tfm = crypto_aead_tfm(aead);
- struct xilinx_aead_tfm_ctx *tfm_ctx =
- (struct xilinx_aead_tfm_ctx *)crypto_tfm_ctx(tfm);
+ struct xilinx_aead_tfm_ctx *tfm_ctx = crypto_tfm_ctx(tfm);
tfm_ctx->authsize = authsize;
return crypto_aead_setauthsize(tfm_ctx->fbk_cipher, authsize);
@@ -345,8 +344,7 @@ static int zynqmp_aes_aead_decrypt(struct aead_request *req)
static int xilinx_aes_aead_init(struct crypto_aead *aead)
{
struct crypto_tfm *tfm = crypto_aead_tfm(aead);
- struct xilinx_aead_tfm_ctx *tfm_ctx =
- (struct xilinx_aead_tfm_ctx *)crypto_tfm_ctx(tfm);
+ struct xilinx_aead_tfm_ctx *tfm_ctx = crypto_tfm_ctx(tfm);
struct xilinx_aead_drv_ctx *drv_ctx;
struct aead_alg *alg = crypto_aead_alg(aead);
@@ -388,8 +386,7 @@ static int xilinx_aes_aead_init(struct crypto_aead *aead)
static void xilinx_aes_aead_exit(struct crypto_aead *aead)
{
struct crypto_tfm *tfm = crypto_aead_tfm(aead);
- struct xilinx_aead_tfm_ctx *tfm_ctx =
- (struct xilinx_aead_tfm_ctx *)crypto_tfm_ctx(tfm);
+ struct xilinx_aead_tfm_ctx *tfm_ctx = crypto_tfm_ctx(tfm);
dma_unmap_single(tfm_ctx->dev, tfm_ctx->key_dma_addr, AES_KEYSIZE_256, DMA_TO_DEVICE);
kfree(tfm_ctx->key);
--
2.49.1
More information about the linux-arm-kernel
mailing list