[PATCH v2 11/19] crypto: mediatek: convert tasklets to use new tasklet_setup() API
Allen Pais
allen.lkml at gmail.com
Thu Jan 7 07:29:36 EST 2021
From: Allen Pais <apais at linux.microsoft.com>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier at gmail.com>
Signed-off-by: Allen Pais <apais at linux.microsoft.com>
---
drivers/crypto/mediatek/mtk-aes.c | 14 ++++++--------
drivers/crypto/mediatek/mtk-sha.c | 14 ++++++--------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c
index 7323066724c3..fa49bb5b043b 100644
--- a/drivers/crypto/mediatek/mtk-aes.c
+++ b/drivers/crypto/mediatek/mtk-aes.c
@@ -1080,16 +1080,16 @@ static struct aead_alg aes_gcm_alg = {
},
};
-static void mtk_aes_queue_task(unsigned long data)
+static void mtk_aes_queue_task(struct tasklet_struct *t)
{
- struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data;
+ struct mtk_aes_rec *aes = from_tasklet(aes, t, queue_task);
mtk_aes_handle_queue(aes->cryp, aes->id, NULL);
}
-static void mtk_aes_done_task(unsigned long data)
+static void mtk_aes_done_task(struct tasklet_struct *t)
{
- struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data;
+ struct mtk_aes_rec *aes = from_tasklet(aes, t, done_task);
struct mtk_cryp *cryp = aes->cryp;
mtk_aes_unmap(cryp, aes);
@@ -1142,10 +1142,8 @@ static int mtk_aes_record_init(struct mtk_cryp *cryp)
spin_lock_init(&aes[i]->lock);
crypto_init_queue(&aes[i]->queue, AES_QUEUE_SIZE);
- tasklet_init(&aes[i]->queue_task, mtk_aes_queue_task,
- (unsigned long)aes[i]);
- tasklet_init(&aes[i]->done_task, mtk_aes_done_task,
- (unsigned long)aes[i]);
+ tasklet_setup(&aes[i]->queue_task, mtk_aes_queue_task);
+ tasklet_setup(&aes[i]->done_task, mtk_aes_done_task);
}
/* Link to ring0 and ring1 respectively */
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c
index f55aacdafbef..c241762aa23b 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -1164,16 +1164,16 @@ static struct ahash_alg algs_sha384_sha512[] = {
},
};
-static void mtk_sha_queue_task(unsigned long data)
+static void mtk_sha_queue_task(struct tasklet_struct *t)
{
- struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data;
+ struct mtk_sha_rec *sha = from_tasklet(sha, t, queue_task);
mtk_sha_handle_queue(sha->cryp, sha->id - MTK_RING2, NULL);
}
-static void mtk_sha_done_task(unsigned long data)
+static void mtk_sha_done_task(struct tasklet_struct *t)
{
- struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data;
+ struct mtk_sha_rec *sha = from_tasklet(sha, t, done_task);
struct mtk_cryp *cryp = sha->cryp;
mtk_sha_unmap(cryp, sha);
@@ -1219,10 +1219,8 @@ static int mtk_sha_record_init(struct mtk_cryp *cryp)
spin_lock_init(&sha[i]->lock);
crypto_init_queue(&sha[i]->queue, SHA_QUEUE_SIZE);
- tasklet_init(&sha[i]->queue_task, mtk_sha_queue_task,
- (unsigned long)sha[i]);
- tasklet_init(&sha[i]->done_task, mtk_sha_done_task,
- (unsigned long)sha[i]);
+ tasklet_setup(&sha[i]->queue_task, mtk_sha_queue_task);
+ tasklet_setup(&sha[i]->done_task, mtk_sha_done_task);
}
/* Link to ring2 and ring3 respectively */
--
2.25.1
More information about the Linux-rockchip
mailing list